Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf trace: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*()

As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka
libperf, to whom the perf_ prefix belongs.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+25 -29
+25 -29
tools/perf/builtin-trace.c
··· 366 366 return NULL; 367 367 } 368 368 369 - static int perf_evsel__init_tp_uint_field(struct evsel *evsel, 370 - struct tp_field *field, 371 - const char *name) 369 + static int evsel__init_tp_uint_field(struct evsel *evsel, struct tp_field *field, const char *name) 372 370 { 373 371 struct tep_format_field *format_field = evsel__field(evsel, name); 374 372 ··· 378 380 379 381 #define perf_evsel__init_sc_tp_uint_field(evsel, name) \ 380 382 ({ struct syscall_tp *sc = __evsel__syscall_tp(evsel);\ 381 - perf_evsel__init_tp_uint_field(evsel, &sc->name, #name); }) 383 + evsel__init_tp_uint_field(evsel, &sc->name, #name); }) 382 384 383 - static int perf_evsel__init_tp_ptr_field(struct evsel *evsel, 384 - struct tp_field *field, 385 - const char *name) 385 + static int evsel__init_tp_ptr_field(struct evsel *evsel, struct tp_field *field, const char *name) 386 386 { 387 387 struct tep_format_field *format_field = evsel__field(evsel, name); 388 388 ··· 392 396 393 397 #define perf_evsel__init_sc_tp_ptr_field(evsel, name) \ 394 398 ({ struct syscall_tp *sc = __evsel__syscall_tp(evsel);\ 395 - perf_evsel__init_tp_ptr_field(evsel, &sc->name, #name); }) 399 + evsel__init_tp_ptr_field(evsel, &sc->name, #name); }) 396 400 397 401 static void evsel__delete_priv(struct evsel *evsel) 398 402 { ··· 400 404 evsel__delete(evsel); 401 405 } 402 406 403 - static int perf_evsel__init_syscall_tp(struct evsel *evsel) 407 + static int evsel__init_syscall_tp(struct evsel *evsel) 404 408 { 405 409 struct syscall_tp *sc = evsel__syscall_tp(evsel); 406 410 407 411 if (sc != NULL) { 408 - if (perf_evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr") && 409 - perf_evsel__init_tp_uint_field(evsel, &sc->id, "nr")) 412 + if (evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr") && 413 + evsel__init_tp_uint_field(evsel, &sc->id, "nr")) 410 414 return -ENOENT; 411 415 return 0; 412 416 } ··· 414 418 return -ENOMEM; 415 419 } 416 420 417 - static int perf_evsel__init_augmented_syscall_tp(struct evsel *evsel, struct evsel *tp) 421 + static int evsel__init_augmented_syscall_tp(struct evsel *evsel, struct evsel *tp) 418 422 { 419 423 struct syscall_tp *sc = evsel__syscall_tp(evsel); 420 424 ··· 432 436 return -ENOMEM; 433 437 } 434 438 435 - static int perf_evsel__init_augmented_syscall_tp_args(struct evsel *evsel) 439 + static int evsel__init_augmented_syscall_tp_args(struct evsel *evsel) 436 440 { 437 441 struct syscall_tp *sc = __evsel__syscall_tp(evsel); 438 442 439 443 return __tp_field__init_ptr(&sc->args, sc->id.offset + sizeof(u64)); 440 444 } 441 445 442 - static int perf_evsel__init_augmented_syscall_tp_ret(struct evsel *evsel) 446 + static int evsel__init_augmented_syscall_tp_ret(struct evsel *evsel) 443 447 { 444 448 struct syscall_tp *sc = __evsel__syscall_tp(evsel); 445 449 446 450 return __tp_field__init_uint(&sc->ret, sizeof(u64), sc->id.offset + sizeof(u64), evsel->needs_swap); 447 451 } 448 452 449 - static int perf_evsel__init_raw_syscall_tp(struct evsel *evsel, void *handler) 453 + static int evsel__init_raw_syscall_tp(struct evsel *evsel, void *handler) 450 454 { 451 455 if (evsel__syscall_tp(evsel) != NULL) { 452 456 if (perf_evsel__init_sc_tp_uint_field(evsel, id)) ··· 470 474 if (IS_ERR(evsel)) 471 475 return NULL; 472 476 473 - if (perf_evsel__init_raw_syscall_tp(evsel, handler)) 477 + if (evsel__init_raw_syscall_tp(evsel, handler)) 474 478 goto out_delete; 475 479 476 480 return evsel; ··· 1797 1801 return syscall__set_arg_fmts(sc); 1798 1802 } 1799 1803 1800 - static int perf_evsel__init_tp_arg_scnprintf(struct evsel *evsel) 1804 + static int evsel__init_tp_arg_scnprintf(struct evsel *evsel) 1801 1805 { 1802 1806 struct syscall_arg_fmt *fmt = evsel__syscall_arg_fmt(evsel); 1803 1807 ··· 3690 3694 return __trace__deliver_event(trace, event->event); 3691 3695 } 3692 3696 3693 - static struct syscall_arg_fmt *perf_evsel__syscall_arg_fmt(struct evsel *evsel, char *arg) 3697 + static struct syscall_arg_fmt *evsel__find_syscall_arg_fmt_by_name(struct evsel *evsel, char *arg) 3694 3698 { 3695 3699 struct tep_format_field *field; 3696 3700 struct syscall_arg_fmt *fmt = __evsel__syscall_arg_fmt(evsel); ··· 3745 3749 3746 3750 scnprintf(arg, sizeof(arg), "%.*s", left_size, left); 3747 3751 3748 - fmt = perf_evsel__syscall_arg_fmt(evsel, arg); 3752 + fmt = evsel__find_syscall_arg_fmt_by_name(evsel, arg); 3749 3753 if (fmt == NULL) { 3750 3754 pr_err("\"%s\" not found in \"%s\", can't set filter \"%s\"\n", 3751 3755 arg, evsel->name, evsel->filter); ··· 4174 4178 "syscalls:sys_enter"); 4175 4179 4176 4180 if (evsel && 4177 - (perf_evsel__init_raw_syscall_tp(evsel, trace__sys_enter) < 0 || 4181 + (evsel__init_raw_syscall_tp(evsel, trace__sys_enter) < 0 || 4178 4182 perf_evsel__init_sc_tp_ptr_field(evsel, args))) { 4179 4183 pr_err("Error during initialize raw_syscalls:sys_enter event\n"); 4180 4184 goto out; ··· 4186 4190 evsel = perf_evlist__find_tracepoint_by_name(session->evlist, 4187 4191 "syscalls:sys_exit"); 4188 4192 if (evsel && 4189 - (perf_evsel__init_raw_syscall_tp(evsel, trace__sys_exit) < 0 || 4193 + (evsel__init_raw_syscall_tp(evsel, trace__sys_exit) < 0 || 4190 4194 perf_evsel__init_sc_tp_uint_field(evsel, ret))) { 4191 4195 pr_err("Error during initialize raw_syscalls:sys_exit event\n"); 4192 4196 goto out; ··· 4466 4470 continue; 4467 4471 4468 4472 if (strcmp(evsel->tp_format->system, "syscalls")) { 4469 - perf_evsel__init_tp_arg_scnprintf(evsel); 4473 + evsel__init_tp_arg_scnprintf(evsel); 4470 4474 continue; 4471 4475 } 4472 4476 4473 - if (perf_evsel__init_syscall_tp(evsel)) 4477 + if (evsel__init_syscall_tp(evsel)) 4474 4478 return -1; 4475 4479 4476 4480 if (!strncmp(evsel->tp_format->name, "sys_enter_", 10)) { ··· 4994 4998 if (trace.syscalls.events.augmented->priv == NULL && 4995 4999 strstr(evsel__name(evsel), "syscalls:sys_enter")) { 4996 5000 struct evsel *augmented = trace.syscalls.events.augmented; 4997 - if (perf_evsel__init_augmented_syscall_tp(augmented, evsel) || 4998 - perf_evsel__init_augmented_syscall_tp_args(augmented)) 5001 + if (evsel__init_augmented_syscall_tp(augmented, evsel) || 5002 + evsel__init_augmented_syscall_tp_args(augmented)) 4999 5003 goto out; 5000 5004 /* 5001 5005 * Augmented is __augmented_syscalls__ BPF_OUTPUT event ··· 5009 5013 * as not to filter it, then we'll handle it just like we would 5010 5014 * for the BPF_OUTPUT one: 5011 5015 */ 5012 - if (perf_evsel__init_augmented_syscall_tp(evsel, evsel) || 5013 - perf_evsel__init_augmented_syscall_tp_args(evsel)) 5016 + if (evsel__init_augmented_syscall_tp(evsel, evsel) || 5017 + evsel__init_augmented_syscall_tp_args(evsel)) 5014 5018 goto out; 5015 5019 evsel->handler = trace__sys_enter; 5016 5020 } ··· 5018 5022 if (strstarts(evsel__name(evsel), "syscalls:sys_exit_")) { 5019 5023 struct syscall_tp *sc; 5020 5024 init_augmented_syscall_tp: 5021 - if (perf_evsel__init_augmented_syscall_tp(evsel, evsel)) 5025 + if (evsel__init_augmented_syscall_tp(evsel, evsel)) 5022 5026 goto out; 5023 5027 sc = __evsel__syscall_tp(evsel); 5024 5028 /* ··· 5042 5046 */ 5043 5047 if (trace.raw_augmented_syscalls) 5044 5048 trace.raw_augmented_syscalls_args_size = (6 + 1) * sizeof(long) + sc->id.offset; 5045 - perf_evsel__init_augmented_syscall_tp_ret(evsel); 5049 + evsel__init_augmented_syscall_tp_ret(evsel); 5046 5050 evsel->handler = trace__sys_exit; 5047 5051 } 5048 5052 }