Need metric set resize function
morrone opened this issue · comments
When we want to change the size the heap of a metric set right now, we just have to delete the metric set and create a new one. I believe that we are adding functions to ldms to allow changing metric set permissions manually, and that doesn't play well with this model. When a sampler deletes a metric set and creates a new one, any changes to thing metric set made externally to the sampler will be lost when the metric set is recreated.
The sampler author shouldn't need to know about or track those changes to the metric set, so really what we need is a new API call to allow us to delete a metric set and create a new one with the same properties (but different heap size) than the previous one.
We should keep in mind that resizes will happen to shrink the heap size as well, not only to grow the heap size.
set_t ldms_set_realloc(set_t set, size_t new_heap_size)
The resulting set (memory available) would contain all the contents of the previous metric set including permissions, ownership, and set-info with a heap resized to the specified value.