X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fliblttng-ust%2Flttng-context-perf-counters.c;h=5f5b5cbfeac086aaaa5117fd08adc21519c51e6e;hb=f72cd4d92d052b93bce77fa5761b14fc2a172bdb;hp=39b51f3b5f8f08b2e96d53c789583ade998da3c3;hpb=b29dc239172407e761a249a3b75f4330a71f4eb3;p=lttng-ust.git diff --git a/src/liblttng-ust/lttng-context-perf-counters.c b/src/liblttng-ust/lttng-context-perf-counters.c index 39b51f3b..5f5b5cbf 100644 --- a/src/liblttng-ust/lttng-context-perf-counters.c +++ b/src/liblttng-ust/lttng-context-perf-counters.c @@ -62,6 +62,7 @@ struct lttng_perf_counter_field { struct perf_event_attr attr; struct cds_list_head thread_field_list; /* Per-field list of thread fields */ char *name; + struct lttng_ust_event_field *event_field; }; static pthread_key_t perf_counter_key; @@ -504,6 +505,7 @@ void lttng_destroy_perf_counter_ctx_field(void *priv) thread_field_node) lttng_destroy_perf_thread_field(pos); lttng_perf_unlock(); + free(perf_field->event_field); free(perf_field); } @@ -570,6 +572,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, perf_field->attr.exclude_kernel = perf_get_exclude_kernel(); CDS_INIT_LIST_HEAD(&perf_field->thread_field_list); perf_field->name = name_alloc; + perf_field->event_field = event_field; /* Ensure that this perf counter can be used in this process. */ ret = open_perf_fd(&perf_field->attr);