Skip to content

Commit ec98b6d

Browse files
committed
perf script: 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 3b7313f commit ec98b6d

File tree

1 file changed

+19
-34
lines changed

1 file changed

+19
-34
lines changed

tools/perf/builtin-script.c

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,8 @@ static const char *output_field2str(enum perf_output_field field)
351351

352352
#define PRINT_FIELD(x) (output[output_type(attr->type)].fields & PERF_OUTPUT_##x)
353353

354-
static int perf_evsel__do_check_stype(struct evsel *evsel,
355-
u64 sample_type, const char *sample_msg,
356-
enum perf_output_field field,
357-
bool allow_user_set)
354+
static int evsel__do_check_stype(struct evsel *evsel, u64 sample_type, const char *sample_msg,
355+
enum perf_output_field field, bool allow_user_set)
358356
{
359357
struct perf_event_attr *attr = &evsel->core.attr;
360358
int type = output_type(attr->type);
@@ -383,16 +381,13 @@ static int perf_evsel__do_check_stype(struct evsel *evsel,
383381
return 0;
384382
}
385383

386-
static int perf_evsel__check_stype(struct evsel *evsel,
387-
u64 sample_type, const char *sample_msg,
388-
enum perf_output_field field)
384+
static int evsel__check_stype(struct evsel *evsel, u64 sample_type, const char *sample_msg,
385+
enum perf_output_field field)
389386
{
390-
return perf_evsel__do_check_stype(evsel, sample_type, sample_msg, field,
391-
false);
387+
return evsel__do_check_stype(evsel, sample_type, sample_msg, field, false);
392388
}
393389

394-
static int perf_evsel__check_attr(struct evsel *evsel,
395-
struct perf_session *session)
390+
static int perf_evsel__check_attr(struct evsel *evsel, struct perf_session *session)
396391
{
397392
struct perf_event_attr *attr = &evsel->core.attr;
398393
bool allow_user_set;
@@ -404,32 +399,28 @@ static int perf_evsel__check_attr(struct evsel *evsel,
404399
HEADER_AUXTRACE);
405400

406401
if (PRINT_FIELD(TRACE) &&
407-
!perf_session__has_traces(session, "record -R"))
402+
!perf_session__has_traces(session, "record -R"))
408403
return -EINVAL;
409404

410405
if (PRINT_FIELD(IP)) {
411-
if (perf_evsel__check_stype(evsel, PERF_SAMPLE_IP, "IP",
412-
PERF_OUTPUT_IP))
406+
if (evsel__check_stype(evsel, PERF_SAMPLE_IP, "IP", PERF_OUTPUT_IP))
413407
return -EINVAL;
414408
}
415409

416410
if (PRINT_FIELD(ADDR) &&
417-
perf_evsel__do_check_stype(evsel, PERF_SAMPLE_ADDR, "ADDR",
418-
PERF_OUTPUT_ADDR, allow_user_set))
411+
evsel__do_check_stype(evsel, PERF_SAMPLE_ADDR, "ADDR", PERF_OUTPUT_ADDR, allow_user_set))
419412
return -EINVAL;
420413

421414
if (PRINT_FIELD(DATA_SRC) &&
422-
perf_evsel__check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC",
423-
PERF_OUTPUT_DATA_SRC))
415+
evsel__check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC", PERF_OUTPUT_DATA_SRC))
424416
return -EINVAL;
425417

426418
if (PRINT_FIELD(WEIGHT) &&
427-
perf_evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT",
428-
PERF_OUTPUT_WEIGHT))
419+
evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT", PERF_OUTPUT_WEIGHT))
429420
return -EINVAL;
430421

431422
if (PRINT_FIELD(SYM) &&
432-
!(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) {
423+
!(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) {
433424
pr_err("Display of symbols requested but neither sample IP nor "
434425
"sample address\navailable. Hence, no addresses to convert "
435426
"to symbols.\n");
@@ -441,7 +432,7 @@ static int perf_evsel__check_attr(struct evsel *evsel,
441432
return -EINVAL;
442433
}
443434
if (PRINT_FIELD(DSO) &&
444-
!(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) {
435+
!(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) {
445436
pr_err("Display of DSO requested but no address to convert.\n");
446437
return -EINVAL;
447438
}
@@ -458,33 +449,27 @@ static int perf_evsel__check_attr(struct evsel *evsel,
458449
return -EINVAL;
459450
}
460451
if ((PRINT_FIELD(PID) || PRINT_FIELD(TID)) &&
461-
perf_evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID",
462-
PERF_OUTPUT_TID|PERF_OUTPUT_PID))
452+
evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID", PERF_OUTPUT_TID|PERF_OUTPUT_PID))
463453
return -EINVAL;
464454

465455
if (PRINT_FIELD(TIME) &&
466-
perf_evsel__check_stype(evsel, PERF_SAMPLE_TIME, "TIME",
467-
PERF_OUTPUT_TIME))
456+
evsel__check_stype(evsel, PERF_SAMPLE_TIME, "TIME", PERF_OUTPUT_TIME))
468457
return -EINVAL;
469458

470459
if (PRINT_FIELD(CPU) &&
471-
perf_evsel__do_check_stype(evsel, PERF_SAMPLE_CPU, "CPU",
472-
PERF_OUTPUT_CPU, allow_user_set))
460+
evsel__do_check_stype(evsel, PERF_SAMPLE_CPU, "CPU", PERF_OUTPUT_CPU, allow_user_set))
473461
return -EINVAL;
474462

475463
if (PRINT_FIELD(IREGS) &&
476-
perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_INTR, "IREGS",
477-
PERF_OUTPUT_IREGS))
464+
evsel__check_stype(evsel, PERF_SAMPLE_REGS_INTR, "IREGS", PERF_OUTPUT_IREGS))
478465
return -EINVAL;
479466

480467
if (PRINT_FIELD(UREGS) &&
481-
perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_USER, "UREGS",
482-
PERF_OUTPUT_UREGS))
468+
evsel__check_stype(evsel, PERF_SAMPLE_REGS_USER, "UREGS", PERF_OUTPUT_UREGS))
483469
return -EINVAL;
484470

485471
if (PRINT_FIELD(PHYS_ADDR) &&
486-
perf_evsel__check_stype(evsel, PERF_SAMPLE_PHYS_ADDR, "PHYS_ADDR",
487-
PERF_OUTPUT_PHYS_ADDR))
472+
evsel__check_stype(evsel, PERF_SAMPLE_PHYS_ADDR, "PHYS_ADDR", PERF_OUTPUT_PHYS_ADDR))
488473
return -EINVAL;
489474

490475
return 0;

0 commit comments

Comments
 (0)