diff options
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index d741c0aa2750..69133b35bbc1 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -345,7 +345,7 @@ static int perf_evsel__do_check_stype(struct evsel *evsel, | |||
345 | enum perf_output_field field, | 345 | enum perf_output_field field, |
346 | bool allow_user_set) | 346 | bool allow_user_set) |
347 | { | 347 | { |
348 | struct perf_event_attr *attr = &evsel->attr; | 348 | struct perf_event_attr *attr = &evsel->core.attr; |
349 | int type = output_type(attr->type); | 349 | int type = output_type(attr->type); |
350 | const char *evname; | 350 | const char *evname; |
351 | 351 | ||
@@ -383,7 +383,7 @@ static int perf_evsel__check_stype(struct evsel *evsel, | |||
383 | static int perf_evsel__check_attr(struct evsel *evsel, | 383 | static int perf_evsel__check_attr(struct evsel *evsel, |
384 | struct perf_session *session) | 384 | struct perf_session *session) |
385 | { | 385 | { |
386 | struct perf_event_attr *attr = &evsel->attr; | 386 | struct perf_event_attr *attr = &evsel->core.attr; |
387 | bool allow_user_set; | 387 | bool allow_user_set; |
388 | 388 | ||
389 | if (perf_header__has_feat(&session->header, HEADER_STAT)) | 389 | if (perf_header__has_feat(&session->header, HEADER_STAT)) |
@@ -418,7 +418,7 @@ static int perf_evsel__check_attr(struct evsel *evsel, | |||
418 | return -EINVAL; | 418 | return -EINVAL; |
419 | 419 | ||
420 | if (PRINT_FIELD(SYM) && | 420 | if (PRINT_FIELD(SYM) && |
421 | !(evsel->attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { | 421 | !(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { |
422 | pr_err("Display of symbols requested but neither sample IP nor " | 422 | pr_err("Display of symbols requested but neither sample IP nor " |
423 | "sample address\navailable. Hence, no addresses to convert " | 423 | "sample address\navailable. Hence, no addresses to convert " |
424 | "to symbols.\n"); | 424 | "to symbols.\n"); |
@@ -430,7 +430,7 @@ static int perf_evsel__check_attr(struct evsel *evsel, | |||
430 | return -EINVAL; | 430 | return -EINVAL; |
431 | } | 431 | } |
432 | if (PRINT_FIELD(DSO) && | 432 | if (PRINT_FIELD(DSO) && |
433 | !(evsel->attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { | 433 | !(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { |
434 | pr_err("Display of DSO requested but no address to convert.\n"); | 434 | pr_err("Display of DSO requested but no address to convert.\n"); |
435 | return -EINVAL; | 435 | return -EINVAL; |
436 | } | 436 | } |
@@ -531,7 +531,7 @@ static int perf_session__check_output_opt(struct perf_session *session) | |||
531 | if (evsel == NULL) | 531 | if (evsel == NULL) |
532 | continue; | 532 | continue; |
533 | 533 | ||
534 | set_print_ip_opts(&evsel->attr); | 534 | set_print_ip_opts(&evsel->core.attr); |
535 | } | 535 | } |
536 | 536 | ||
537 | if (!no_callchain) { | 537 | if (!no_callchain) { |
@@ -558,7 +558,7 @@ static int perf_session__check_output_opt(struct perf_session *session) | |||
558 | j = PERF_TYPE_TRACEPOINT; | 558 | j = PERF_TYPE_TRACEPOINT; |
559 | 559 | ||
560 | evlist__for_each_entry(session->evlist, evsel) { | 560 | evlist__for_each_entry(session->evlist, evsel) { |
561 | if (evsel->attr.type != j) | 561 | if (evsel->core.attr.type != j) |
562 | continue; | 562 | continue; |
563 | 563 | ||
564 | if (evsel__has_callchain(evsel)) { | 564 | if (evsel__has_callchain(evsel)) { |
@@ -566,7 +566,7 @@ static int perf_session__check_output_opt(struct perf_session *session) | |||
566 | output[j].fields |= PERF_OUTPUT_SYM; | 566 | output[j].fields |= PERF_OUTPUT_SYM; |
567 | output[j].fields |= PERF_OUTPUT_SYMOFFSET; | 567 | output[j].fields |= PERF_OUTPUT_SYMOFFSET; |
568 | output[j].fields |= PERF_OUTPUT_DSO; | 568 | output[j].fields |= PERF_OUTPUT_DSO; |
569 | set_print_ip_opts(&evsel->attr); | 569 | set_print_ip_opts(&evsel->core.attr); |
570 | goto out; | 570 | goto out; |
571 | } | 571 | } |
572 | } | 572 | } |
@@ -617,7 +617,7 @@ static int perf_sample__fprintf_start(struct perf_sample *sample, | |||
617 | struct evsel *evsel, | 617 | struct evsel *evsel, |
618 | u32 type, FILE *fp) | 618 | u32 type, FILE *fp) |
619 | { | 619 | { |
620 | struct perf_event_attr *attr = &evsel->attr; | 620 | struct perf_event_attr *attr = &evsel->core.attr; |
621 | unsigned long secs; | 621 | unsigned long secs; |
622 | unsigned long long nsecs; | 622 | unsigned long long nsecs; |
623 | int printed = 0; | 623 | int printed = 0; |
@@ -1168,7 +1168,7 @@ static const char *resolve_branch_sym(struct perf_sample *sample, | |||
1168 | u64 *ip) | 1168 | u64 *ip) |
1169 | { | 1169 | { |
1170 | struct addr_location addr_al; | 1170 | struct addr_location addr_al; |
1171 | struct perf_event_attr *attr = &evsel->attr; | 1171 | struct perf_event_attr *attr = &evsel->core.attr; |
1172 | const char *name = NULL; | 1172 | const char *name = NULL; |
1173 | 1173 | ||
1174 | if (sample->flags & (PERF_IP_FLAG_CALL | PERF_IP_FLAG_TRACE_BEGIN)) { | 1174 | if (sample->flags & (PERF_IP_FLAG_CALL | PERF_IP_FLAG_TRACE_BEGIN)) { |
@@ -1195,7 +1195,7 @@ static int perf_sample__fprintf_callindent(struct perf_sample *sample, | |||
1195 | struct thread *thread, | 1195 | struct thread *thread, |
1196 | struct addr_location *al, FILE *fp) | 1196 | struct addr_location *al, FILE *fp) |
1197 | { | 1197 | { |
1198 | struct perf_event_attr *attr = &evsel->attr; | 1198 | struct perf_event_attr *attr = &evsel->core.attr; |
1199 | size_t depth = thread_stack__depth(thread, sample->cpu); | 1199 | size_t depth = thread_stack__depth(thread, sample->cpu); |
1200 | const char *name = NULL; | 1200 | const char *name = NULL; |
1201 | static int spacing; | 1201 | static int spacing; |
@@ -1290,7 +1290,7 @@ static int perf_sample__fprintf_bts(struct perf_sample *sample, | |||
1290 | struct addr_location *al, | 1290 | struct addr_location *al, |
1291 | struct machine *machine, FILE *fp) | 1291 | struct machine *machine, FILE *fp) |
1292 | { | 1292 | { |
1293 | struct perf_event_attr *attr = &evsel->attr; | 1293 | struct perf_event_attr *attr = &evsel->core.attr; |
1294 | unsigned int type = output_type(attr->type); | 1294 | unsigned int type = output_type(attr->type); |
1295 | bool print_srcline_last = false; | 1295 | bool print_srcline_last = false; |
1296 | int printed = 0; | 1296 | int printed = 0; |
@@ -1322,7 +1322,7 @@ static int perf_sample__fprintf_bts(struct perf_sample *sample, | |||
1322 | 1322 | ||
1323 | /* print branch_to information */ | 1323 | /* print branch_to information */ |
1324 | if (PRINT_FIELD(ADDR) || | 1324 | if (PRINT_FIELD(ADDR) || |
1325 | ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) && | 1325 | ((evsel->core.attr.sample_type & PERF_SAMPLE_ADDR) && |
1326 | !output[type].user_set)) { | 1326 | !output[type].user_set)) { |
1327 | printed += fprintf(fp, " => "); | 1327 | printed += fprintf(fp, " => "); |
1328 | printed += perf_sample__fprintf_addr(sample, thread, attr, fp); | 1328 | printed += perf_sample__fprintf_addr(sample, thread, attr, fp); |
@@ -1595,7 +1595,7 @@ static int perf_sample__fprintf_synth_cbr(struct perf_sample *sample, FILE *fp) | |||
1595 | static int perf_sample__fprintf_synth(struct perf_sample *sample, | 1595 | static int perf_sample__fprintf_synth(struct perf_sample *sample, |
1596 | struct evsel *evsel, FILE *fp) | 1596 | struct evsel *evsel, FILE *fp) |
1597 | { | 1597 | { |
1598 | switch (evsel->attr.config) { | 1598 | switch (evsel->core.attr.config) { |
1599 | case PERF_SYNTH_INTEL_PTWRITE: | 1599 | case PERF_SYNTH_INTEL_PTWRITE: |
1600 | return perf_sample__fprintf_synth_ptwrite(sample, fp); | 1600 | return perf_sample__fprintf_synth_ptwrite(sample, fp); |
1601 | case PERF_SYNTH_INTEL_MWAIT: | 1601 | case PERF_SYNTH_INTEL_MWAIT: |
@@ -1793,7 +1793,7 @@ static void process_event(struct perf_script *script, | |||
1793 | struct machine *machine) | 1793 | struct machine *machine) |
1794 | { | 1794 | { |
1795 | struct thread *thread = al->thread; | 1795 | struct thread *thread = al->thread; |
1796 | struct perf_event_attr *attr = &evsel->attr; | 1796 | struct perf_event_attr *attr = &evsel->core.attr; |
1797 | unsigned int type = output_type(attr->type); | 1797 | unsigned int type = output_type(attr->type); |
1798 | struct evsel_script *es = evsel->priv; | 1798 | struct evsel_script *es = evsel->priv; |
1799 | FILE *fp = es->fp; | 1799 | FILE *fp = es->fp; |
@@ -2046,18 +2046,18 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
2046 | } | 2046 | } |
2047 | } | 2047 | } |
2048 | 2048 | ||
2049 | if (evsel->attr.type >= PERF_TYPE_MAX && | 2049 | if (evsel->core.attr.type >= PERF_TYPE_MAX && |
2050 | evsel->attr.type != PERF_TYPE_SYNTH) | 2050 | evsel->core.attr.type != PERF_TYPE_SYNTH) |
2051 | return 0; | 2051 | return 0; |
2052 | 2052 | ||
2053 | evlist__for_each_entry(evlist, pos) { | 2053 | evlist__for_each_entry(evlist, pos) { |
2054 | if (pos->attr.type == evsel->attr.type && pos != evsel) | 2054 | if (pos->core.attr.type == evsel->core.attr.type && pos != evsel) |
2055 | return 0; | 2055 | return 0; |
2056 | } | 2056 | } |
2057 | 2057 | ||
2058 | set_print_ip_opts(&evsel->attr); | 2058 | set_print_ip_opts(&evsel->core.attr); |
2059 | 2059 | ||
2060 | if (evsel->attr.sample_type) | 2060 | if (evsel->core.attr.sample_type) |
2061 | err = perf_evsel__check_attr(evsel, scr->session); | 2061 | err = perf_evsel__check_attr(evsel, scr->session); |
2062 | 2062 | ||
2063 | return err; | 2063 | return err; |
@@ -2083,7 +2083,7 @@ static int process_comm_event(struct perf_tool *tool, | |||
2083 | if (perf_event__process_comm(tool, event, sample, machine) < 0) | 2083 | if (perf_event__process_comm(tool, event, sample, machine) < 0) |
2084 | goto out; | 2084 | goto out; |
2085 | 2085 | ||
2086 | if (!evsel->attr.sample_id_all) { | 2086 | if (!evsel->core.attr.sample_id_all) { |
2087 | sample->cpu = 0; | 2087 | sample->cpu = 0; |
2088 | sample->time = 0; | 2088 | sample->time = 0; |
2089 | sample->tid = event->comm.tid; | 2089 | sample->tid = event->comm.tid; |
@@ -2121,7 +2121,7 @@ static int process_namespaces_event(struct perf_tool *tool, | |||
2121 | if (perf_event__process_namespaces(tool, event, sample, machine) < 0) | 2121 | if (perf_event__process_namespaces(tool, event, sample, machine) < 0) |
2122 | goto out; | 2122 | goto out; |
2123 | 2123 | ||
2124 | if (!evsel->attr.sample_id_all) { | 2124 | if (!evsel->core.attr.sample_id_all) { |
2125 | sample->cpu = 0; | 2125 | sample->cpu = 0; |
2126 | sample->time = 0; | 2126 | sample->time = 0; |
2127 | sample->tid = event->namespaces.tid; | 2127 | sample->tid = event->namespaces.tid; |
@@ -2157,7 +2157,7 @@ static int process_fork_event(struct perf_tool *tool, | |||
2157 | return -1; | 2157 | return -1; |
2158 | } | 2158 | } |
2159 | 2159 | ||
2160 | if (!evsel->attr.sample_id_all) { | 2160 | if (!evsel->core.attr.sample_id_all) { |
2161 | sample->cpu = 0; | 2161 | sample->cpu = 0; |
2162 | sample->time = event->fork.time; | 2162 | sample->time = event->fork.time; |
2163 | sample->tid = event->fork.tid; | 2163 | sample->tid = event->fork.tid; |
@@ -2189,7 +2189,7 @@ static int process_exit_event(struct perf_tool *tool, | |||
2189 | return -1; | 2189 | return -1; |
2190 | } | 2190 | } |
2191 | 2191 | ||
2192 | if (!evsel->attr.sample_id_all) { | 2192 | if (!evsel->core.attr.sample_id_all) { |
2193 | sample->cpu = 0; | 2193 | sample->cpu = 0; |
2194 | sample->time = 0; | 2194 | sample->time = 0; |
2195 | sample->tid = event->fork.tid; | 2195 | sample->tid = event->fork.tid; |
@@ -2227,7 +2227,7 @@ static int process_mmap_event(struct perf_tool *tool, | |||
2227 | return -1; | 2227 | return -1; |
2228 | } | 2228 | } |
2229 | 2229 | ||
2230 | if (!evsel->attr.sample_id_all) { | 2230 | if (!evsel->core.attr.sample_id_all) { |
2231 | sample->cpu = 0; | 2231 | sample->cpu = 0; |
2232 | sample->time = 0; | 2232 | sample->time = 0; |
2233 | sample->tid = event->mmap.tid; | 2233 | sample->tid = event->mmap.tid; |
@@ -2261,7 +2261,7 @@ static int process_mmap2_event(struct perf_tool *tool, | |||
2261 | return -1; | 2261 | return -1; |
2262 | } | 2262 | } |
2263 | 2263 | ||
2264 | if (!evsel->attr.sample_id_all) { | 2264 | if (!evsel->core.attr.sample_id_all) { |
2265 | sample->cpu = 0; | 2265 | sample->cpu = 0; |
2266 | sample->time = 0; | 2266 | sample->time = 0; |
2267 | sample->tid = event->mmap2.tid; | 2267 | sample->tid = event->mmap2.tid; |
@@ -2360,7 +2360,7 @@ process_bpf_events(struct perf_tool *tool __maybe_unused, | |||
2360 | if (machine__process_ksymbol(machine, event, sample) < 0) | 2360 | if (machine__process_ksymbol(machine, event, sample) < 0) |
2361 | return -1; | 2361 | return -1; |
2362 | 2362 | ||
2363 | if (!evsel->attr.sample_id_all) { | 2363 | if (!evsel->core.attr.sample_id_all) { |
2364 | perf_event__fprintf(event, stdout); | 2364 | perf_event__fprintf(event, stdout); |
2365 | return 0; | 2365 | return 0; |
2366 | } | 2366 | } |