@@ -299,6 +299,10 @@ struct tracefs_hist *
tracefs_hist_alloc(struct tracefs_instance * instance,
const char *system, const char *event,
struct tracefs_hist_axis *axes);
+const char *tracefs_get_hist_name(struct tracefs_hist *hist);
+const char *tracefs_get_hist_event(struct tracefs_hist *hist);
+const char *tracefs_get_hist_system(struct tracefs_hist *hist);
+struct tracefs_instance *tracefs_get_hist_instance(struct tracefs_hist *hist);
int tracefs_hist_add_key(struct tracefs_hist *hist, const char *key,
enum tracefs_hist_key_type type);
int tracefs_hist_add_value(struct tracefs_hist *hist, const char *value);
@@ -34,6 +34,26 @@ struct tracefs_hist {
int size;
};
+const char *tracefs_get_hist_name(struct tracefs_hist *hist)
+{
+ return hist ? hist->name : NULL;
+}
+
+struct tracefs_instance *tracefs_get_hist_instance(struct tracefs_hist *hist)
+{
+ return hist ? hist->instance : NULL;
+}
+
+const char *tracefs_get_hist_event(struct tracefs_hist *hist)
+{
+ return hist ? hist->event : NULL;
+}
+
+const char *tracefs_get_hist_system(struct tracefs_hist *hist)
+{
+ return hist ? hist->system : NULL;
+}
+
enum tracefs_hist_command {
HIST_CMD_NONE = 0,
HIST_CMD_PAUSE,
The new APIs will be valuable in a number of different scenarios. For example if the user wants to implement a function that does the readout of a histogram, the only argument that will have to be passed to this function is the histogram descriptor. The same applies for the case when the user wants to print an adequate error message in a case of a failure. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- include/tracefs.h | 4 ++++ src/tracefs-hist.c | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+)