@@ -351,10 +351,8 @@ static const char *output_field2str(enum perf_output_field field)
351
351
352
352
#define PRINT_FIELD (x ) (output[output_type(attr->type)].fields & PERF_OUTPUT_##x)
353
353
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 )
358
356
{
359
357
struct perf_event_attr * attr = & evsel -> core .attr ;
360
358
int type = output_type (attr -> type );
@@ -383,16 +381,13 @@ static int perf_evsel__do_check_stype(struct evsel *evsel,
383
381
return 0 ;
384
382
}
385
383
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 )
389
386
{
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);
392
388
}
393
389
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 )
396
391
{
397
392
struct perf_event_attr * attr = & evsel -> core .attr ;
398
393
bool allow_user_set ;
@@ -404,32 +399,28 @@ static int perf_evsel__check_attr(struct evsel *evsel,
404
399
HEADER_AUXTRACE );
405
400
406
401
if (PRINT_FIELD (TRACE ) &&
407
- !perf_session__has_traces (session , "record -R" ))
402
+ !perf_session__has_traces (session , "record -R" ))
408
403
return - EINVAL ;
409
404
410
405
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 ))
413
407
return - EINVAL ;
414
408
}
415
409
416
410
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 ))
419
412
return - EINVAL ;
420
413
421
414
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 ))
424
416
return - EINVAL ;
425
417
426
418
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 ))
429
420
return - EINVAL ;
430
421
431
422
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 ))) {
433
424
pr_err ("Display of symbols requested but neither sample IP nor "
434
425
"sample address\navailable. Hence, no addresses to convert "
435
426
"to symbols.\n" );
@@ -441,7 +432,7 @@ static int perf_evsel__check_attr(struct evsel *evsel,
441
432
return - EINVAL ;
442
433
}
443
434
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 ))) {
445
436
pr_err ("Display of DSO requested but no address to convert.\n" );
446
437
return - EINVAL ;
447
438
}
@@ -458,33 +449,27 @@ static int perf_evsel__check_attr(struct evsel *evsel,
458
449
return - EINVAL ;
459
450
}
460
451
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 ))
463
453
return - EINVAL ;
464
454
465
455
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 ))
468
457
return - EINVAL ;
469
458
470
459
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 ))
473
461
return - EINVAL ;
474
462
475
463
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 ))
478
465
return - EINVAL ;
479
466
480
467
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 ))
483
469
return - EINVAL ;
484
470
485
471
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 ))
488
473
return - EINVAL ;
489
474
490
475
return 0 ;
0 commit comments