Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323902
b: refs/heads/master
c: e48ffe2
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Sep 26, 2012
1 parent 9dac280 commit ea9c827
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 745cefc5fba4350243bcb63cd6f75fb47ca77725
refs/heads/master: e48ffe2bd49936314d367a8c6b5eaaa17d581d13
9 changes: 5 additions & 4 deletions trunk/tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ struct perf_evsel *perf_evsel__newtp(const char *sys, const char *name, int idx)
PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD),
};

if (asprintf(&evsel->name, "%s:%s", sys, name) < 0)
goto out_free;

evsel->tp_format = event_format__new(sys, name);
if (evsel->tp_format == NULL)
goto out_free;
Expand All @@ -130,12 +133,12 @@ struct perf_evsel *perf_evsel__newtp(const char *sys, const char *name, int idx)
attr.config = evsel->tp_format->id;
attr.sample_period = 1;
perf_evsel__init(evsel, &attr, idx);
evsel->name = evsel->tp_format->name;
}

return evsel;

out_free:
free(evsel->name);
free(evsel);
return NULL;
}
Expand Down Expand Up @@ -584,10 +587,8 @@ void perf_evsel__delete(struct perf_evsel *evsel)
perf_evsel__exit(evsel);
close_cgroup(evsel->cgrp);
free(evsel->group_name);
if (evsel->tp_format && evsel->name == evsel->tp_format->name) {
evsel->name = NULL;
if (evsel->tp_format)
pevent_free_format(evsel->tp_format);
}
free(evsel->name);
free(evsel);
}
Expand Down

0 comments on commit ea9c827

Please sign in to comment.