summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-11 22:45:41 -0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 10:37:43 -0200
commit10d0f086df77f3ff259b46cb501362dbaf2c7989 (patch)
tree69c8d8ccca5545c524abe0ac52a149e78fbc279f /tools/perf/util/header.c
parent81e36bffad95e015af9741b5b1ee16afe08aab05 (diff)
downloadblackbird-op-linux-10d0f086df77f3ff259b46cb501362dbaf2c7989.tar.gz
blackbird-op-linux-10d0f086df77f3ff259b46cb501362dbaf2c7989.zip
perf event: perf_event_ops->attr() manipulates only an evlist
Removing another case where a perf_session is required when processing events. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-ug1wtjbnva4bxwknflkkrlrh@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 41424a16be8e..1fa97dd21200 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2120,23 +2120,23 @@ int perf_session__synthesize_attrs(struct perf_session *session,
}
int perf_event__process_attr(union perf_event *event,
- struct perf_session *session)
+ struct perf_evlist **pevlist)
{
unsigned int i, ids, n_ids;
struct perf_evsel *evsel;
+ struct perf_evlist *evlist = *pevlist;
- if (session->evlist == NULL) {
- session->evlist = perf_evlist__new(NULL, NULL);
- if (session->evlist == NULL)
+ if (evlist == NULL) {
+ *pevlist = evlist = perf_evlist__new(NULL, NULL);
+ if (evlist == NULL)
return -ENOMEM;
}
- evsel = perf_evsel__new(&event->attr.attr,
- session->evlist->nr_entries);
+ evsel = perf_evsel__new(&event->attr.attr, evlist->nr_entries);
if (evsel == NULL)
return -ENOMEM;
- perf_evlist__add(session->evlist, evsel);
+ perf_evlist__add(evlist, evsel);
ids = event->header.size;
ids -= (void *)&event->attr.id - (void *)event;
@@ -2150,12 +2150,9 @@ int perf_event__process_attr(union perf_event *event,
return -ENOMEM;
for (i = 0; i < n_ids; i++) {
- perf_evlist__id_add(session->evlist, evsel, 0, i,
- event->attr.id[i]);
+ perf_evlist__id_add(evlist, evsel, 0, i, event->attr.id[i]);
}
- perf_session__update_sample_type(session);
-
return 0;
}
OpenPOWER on IntegriCloud