Commit 318ec184 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf tools: Switch 'session' argument to 'evlist' in perf_event__synthesize_attrs()

To be able to pass in other than session's evlist.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180830063252.23729-7-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7d9ad16a
...@@ -758,7 +758,7 @@ static int record__synthesize(struct record *rec, bool tail) ...@@ -758,7 +758,7 @@ static int record__synthesize(struct record *rec, bool tail)
* We need to synthesize events first, because some * We need to synthesize events first, because some
* features works on top of them (on report side). * features works on top of them (on report side).
*/ */
err = perf_event__synthesize_attrs(tool, session, err = perf_event__synthesize_attrs(tool, rec->evlist,
process_synthesized_event); process_synthesized_event);
if (err < 0) { if (err < 0) {
pr_err("Couldn't synthesize attrs.\n"); pr_err("Couldn't synthesize attrs.\n");
......
...@@ -459,7 +459,7 @@ static int perf_stat_synthesize_config(bool is_pipe) ...@@ -459,7 +459,7 @@ static int perf_stat_synthesize_config(bool is_pipe)
int err; int err;
if (is_pipe) { if (is_pipe) {
err = perf_event__synthesize_attrs(NULL, perf_stat.session, err = perf_event__synthesize_attrs(NULL, evsel_list,
process_synthesized_event); process_synthesized_event);
if (err < 0) { if (err < 0) {
pr_err("Couldn't synthesize attrs.\n"); pr_err("Couldn't synthesize attrs.\n");
......
...@@ -3637,13 +3637,13 @@ size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp) ...@@ -3637,13 +3637,13 @@ size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp)
} }
int perf_event__synthesize_attrs(struct perf_tool *tool, int perf_event__synthesize_attrs(struct perf_tool *tool,
struct perf_session *session, struct perf_evlist *evlist,
perf_event__handler_t process) perf_event__handler_t process)
{ {
struct perf_evsel *evsel; struct perf_evsel *evsel;
int err = 0; int err = 0;
evlist__for_each_entry(session->evlist, evsel) { evlist__for_each_entry(evlist, evsel) {
err = perf_event__synthesize_attr(tool, &evsel->attr, evsel->ids, err = perf_event__synthesize_attr(tool, &evsel->attr, evsel->ids,
evsel->id, process); evsel->id, process);
if (err) { if (err) {
......
...@@ -124,7 +124,7 @@ int perf_event__synthesize_attr(struct perf_tool *tool, ...@@ -124,7 +124,7 @@ int perf_event__synthesize_attr(struct perf_tool *tool,
struct perf_event_attr *attr, u32 ids, u64 *id, struct perf_event_attr *attr, u32 ids, u64 *id,
perf_event__handler_t process); perf_event__handler_t process);
int perf_event__synthesize_attrs(struct perf_tool *tool, int perf_event__synthesize_attrs(struct perf_tool *tool,
struct perf_session *session, struct perf_evlist *evlist,
perf_event__handler_t process); perf_event__handler_t process);
int perf_event__synthesize_event_update_unit(struct perf_tool *tool, int perf_event__synthesize_event_update_unit(struct perf_tool *tool,
struct perf_evsel *evsel, struct perf_evsel *evsel,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment