Skip to content

Commit 794bca2

Browse files
committed
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 <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ec98b6d commit 794bca2

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

tools/perf/builtin-trace.c

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,7 @@ static struct syscall_arg_fmt *evsel__syscall_arg_fmt(struct evsel *evsel)
366366
return NULL;
367367
}
368368

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)
372370
{
373371
struct tep_format_field *format_field = evsel__field(evsel, name);
374372

@@ -380,11 +378,9 @@ static int perf_evsel__init_tp_uint_field(struct evsel *evsel,
380378

381379
#define perf_evsel__init_sc_tp_uint_field(evsel, name) \
382380
({ struct syscall_tp *sc = __evsel__syscall_tp(evsel);\
383-
perf_evsel__init_tp_uint_field(evsel, &sc->name, #name); })
381+
evsel__init_tp_uint_field(evsel, &sc->name, #name); })
384382

385-
static int perf_evsel__init_tp_ptr_field(struct evsel *evsel,
386-
struct tp_field *field,
387-
const char *name)
383+
static int evsel__init_tp_ptr_field(struct evsel *evsel, struct tp_field *field, const char *name)
388384
{
389385
struct tep_format_field *format_field = evsel__field(evsel, name);
390386

@@ -396,29 +392,29 @@ static int perf_evsel__init_tp_ptr_field(struct evsel *evsel,
396392

397393
#define perf_evsel__init_sc_tp_ptr_field(evsel, name) \
398394
({ struct syscall_tp *sc = __evsel__syscall_tp(evsel);\
399-
perf_evsel__init_tp_ptr_field(evsel, &sc->name, #name); })
395+
evsel__init_tp_ptr_field(evsel, &sc->name, #name); })
400396

401397
static void evsel__delete_priv(struct evsel *evsel)
402398
{
403399
zfree(&evsel->priv);
404400
evsel__delete(evsel);
405401
}
406402

407-
static int perf_evsel__init_syscall_tp(struct evsel *evsel)
403+
static int evsel__init_syscall_tp(struct evsel *evsel)
408404
{
409405
struct syscall_tp *sc = evsel__syscall_tp(evsel);
410406

411407
if (sc != NULL) {
412-
if (perf_evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr") &&
413-
perf_evsel__init_tp_uint_field(evsel, &sc->id, "nr"))
408+
if (evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr") &&
409+
evsel__init_tp_uint_field(evsel, &sc->id, "nr"))
414410
return -ENOENT;
415411
return 0;
416412
}
417413

418414
return -ENOMEM;
419415
}
420416

421-
static int perf_evsel__init_augmented_syscall_tp(struct evsel *evsel, struct evsel *tp)
417+
static int evsel__init_augmented_syscall_tp(struct evsel *evsel, struct evsel *tp)
422418
{
423419
struct syscall_tp *sc = evsel__syscall_tp(evsel);
424420

@@ -436,21 +432,21 @@ static int perf_evsel__init_augmented_syscall_tp(struct evsel *evsel, struct evs
436432
return -ENOMEM;
437433
}
438434

439-
static int perf_evsel__init_augmented_syscall_tp_args(struct evsel *evsel)
435+
static int evsel__init_augmented_syscall_tp_args(struct evsel *evsel)
440436
{
441437
struct syscall_tp *sc = __evsel__syscall_tp(evsel);
442438

443439
return __tp_field__init_ptr(&sc->args, sc->id.offset + sizeof(u64));
444440
}
445441

446-
static int perf_evsel__init_augmented_syscall_tp_ret(struct evsel *evsel)
442+
static int evsel__init_augmented_syscall_tp_ret(struct evsel *evsel)
447443
{
448444
struct syscall_tp *sc = __evsel__syscall_tp(evsel);
449445

450446
return __tp_field__init_uint(&sc->ret, sizeof(u64), sc->id.offset + sizeof(u64), evsel->needs_swap);
451447
}
452448

453-
static int perf_evsel__init_raw_syscall_tp(struct evsel *evsel, void *handler)
449+
static int evsel__init_raw_syscall_tp(struct evsel *evsel, void *handler)
454450
{
455451
if (evsel__syscall_tp(evsel) != NULL) {
456452
if (perf_evsel__init_sc_tp_uint_field(evsel, id))
@@ -474,7 +470,7 @@ static struct evsel *perf_evsel__raw_syscall_newtp(const char *direction, void *
474470
if (IS_ERR(evsel))
475471
return NULL;
476472

477-
if (perf_evsel__init_raw_syscall_tp(evsel, handler))
473+
if (evsel__init_raw_syscall_tp(evsel, handler))
478474
goto out_delete;
479475

480476
return evsel;
@@ -1801,7 +1797,7 @@ static int trace__read_syscall_info(struct trace *trace, int id)
18011797
return syscall__set_arg_fmts(sc);
18021798
}
18031799

1804-
static int perf_evsel__init_tp_arg_scnprintf(struct evsel *evsel)
1800+
static int evsel__init_tp_arg_scnprintf(struct evsel *evsel)
18051801
{
18061802
struct syscall_arg_fmt *fmt = evsel__syscall_arg_fmt(evsel);
18071803

@@ -3694,7 +3690,7 @@ static int ordered_events__deliver_event(struct ordered_events *oe,
36943690
return __trace__deliver_event(trace, event->event);
36953691
}
36963692

3697-
static struct syscall_arg_fmt *perf_evsel__syscall_arg_fmt(struct evsel *evsel, char *arg)
3693+
static struct syscall_arg_fmt *evsel__find_syscall_arg_fmt_by_name(struct evsel *evsel, char *arg)
36983694
{
36993695
struct tep_format_field *field;
37003696
struct syscall_arg_fmt *fmt = __evsel__syscall_arg_fmt(evsel);
@@ -3749,7 +3745,7 @@ static int trace__expand_filter(struct trace *trace __maybe_unused, struct evsel
37493745

37503746
scnprintf(arg, sizeof(arg), "%.*s", left_size, left);
37513747

3752-
fmt = perf_evsel__syscall_arg_fmt(evsel, arg);
3748+
fmt = evsel__find_syscall_arg_fmt_by_name(evsel, arg);
37533749
if (fmt == NULL) {
37543750
pr_err("\"%s\" not found in \"%s\", can't set filter \"%s\"\n",
37553751
arg, evsel->name, evsel->filter);
@@ -4178,7 +4174,7 @@ static int trace__replay(struct trace *trace)
41784174
"syscalls:sys_enter");
41794175

41804176
if (evsel &&
4181-
(perf_evsel__init_raw_syscall_tp(evsel, trace__sys_enter) < 0 ||
4177+
(evsel__init_raw_syscall_tp(evsel, trace__sys_enter) < 0 ||
41824178
perf_evsel__init_sc_tp_ptr_field(evsel, args))) {
41834179
pr_err("Error during initialize raw_syscalls:sys_enter event\n");
41844180
goto out;
@@ -4190,7 +4186,7 @@ static int trace__replay(struct trace *trace)
41904186
evsel = perf_evlist__find_tracepoint_by_name(session->evlist,
41914187
"syscalls:sys_exit");
41924188
if (evsel &&
4193-
(perf_evsel__init_raw_syscall_tp(evsel, trace__sys_exit) < 0 ||
4189+
(evsel__init_raw_syscall_tp(evsel, trace__sys_exit) < 0 ||
41944190
perf_evsel__init_sc_tp_uint_field(evsel, ret))) {
41954191
pr_err("Error during initialize raw_syscalls:sys_exit event\n");
41964192
goto out;
@@ -4470,11 +4466,11 @@ static int evlist__set_syscall_tp_fields(struct evlist *evlist)
44704466
continue;
44714467

44724468
if (strcmp(evsel->tp_format->system, "syscalls")) {
4473-
perf_evsel__init_tp_arg_scnprintf(evsel);
4469+
evsel__init_tp_arg_scnprintf(evsel);
44744470
continue;
44754471
}
44764472

4477-
if (perf_evsel__init_syscall_tp(evsel))
4473+
if (evsel__init_syscall_tp(evsel))
44784474
return -1;
44794475

44804476
if (!strncmp(evsel->tp_format->name, "sys_enter_", 10)) {
@@ -4998,8 +4994,8 @@ int cmd_trace(int argc, const char **argv)
49984994
if (trace.syscalls.events.augmented->priv == NULL &&
49994995
strstr(evsel__name(evsel), "syscalls:sys_enter")) {
50004996
struct evsel *augmented = trace.syscalls.events.augmented;
5001-
if (perf_evsel__init_augmented_syscall_tp(augmented, evsel) ||
5002-
perf_evsel__init_augmented_syscall_tp_args(augmented))
4997+
if (evsel__init_augmented_syscall_tp(augmented, evsel) ||
4998+
evsel__init_augmented_syscall_tp_args(augmented))
50034999
goto out;
50045000
/*
50055001
* Augmented is __augmented_syscalls__ BPF_OUTPUT event
@@ -5013,16 +5009,16 @@ int cmd_trace(int argc, const char **argv)
50135009
* as not to filter it, then we'll handle it just like we would
50145010
* for the BPF_OUTPUT one:
50155011
*/
5016-
if (perf_evsel__init_augmented_syscall_tp(evsel, evsel) ||
5017-
perf_evsel__init_augmented_syscall_tp_args(evsel))
5012+
if (evsel__init_augmented_syscall_tp(evsel, evsel) ||
5013+
evsel__init_augmented_syscall_tp_args(evsel))
50185014
goto out;
50195015
evsel->handler = trace__sys_enter;
50205016
}
50215017

50225018
if (strstarts(evsel__name(evsel), "syscalls:sys_exit_")) {
50235019
struct syscall_tp *sc;
50245020
init_augmented_syscall_tp:
5025-
if (perf_evsel__init_augmented_syscall_tp(evsel, evsel))
5021+
if (evsel__init_augmented_syscall_tp(evsel, evsel))
50265022
goto out;
50275023
sc = __evsel__syscall_tp(evsel);
50285024
/*
@@ -5046,7 +5042,7 @@ int cmd_trace(int argc, const char **argv)
50465042
*/
50475043
if (trace.raw_augmented_syscalls)
50485044
trace.raw_augmented_syscalls_args_size = (6 + 1) * sizeof(long) + sc->id.offset;
5049-
perf_evsel__init_augmented_syscall_tp_ret(evsel);
5045+
evsel__init_augmented_syscall_tp_ret(evsel);
50505046
evsel->handler = trace__sys_exit;
50515047
}
50525048
}

0 commit comments

Comments
 (0)