Skip to content

Commit 174afc3

Browse files
Kan LiangIngo Molnar
authored andcommitted
perf/x86/intel: Rename confusing 'freerunning PEBS' API and implementation to 'large PEBS'
The 'freerunning PEBS' and 'large PEBS' are the same thing. Both of these names appear in the code and in the API, which causes confusion. Rename 'freerunning PEBS' to 'large PEBS' to unify the code, which eliminates the confusion. No functional change. Reported-by: Vince Weaver <[email protected]> Signed-off-by: Kan Liang <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent e340895 commit 174afc3

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

arch/x86/events/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,7 @@ static int x86_pmu_event_init(struct perf_event *event)
21192119
}
21202120

21212121
if (READ_ONCE(x86_pmu.attr_rdpmc) &&
2122-
!(event->hw.flags & PERF_X86_EVENT_FREERUNNING))
2122+
!(event->hw.flags & PERF_X86_EVENT_LARGE_PEBS))
21232123
event->hw.flags |= PERF_X86_EVENT_RDPMC_ALLOWED;
21242124

21252125
return err;

arch/x86/events/intel/core.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,9 +2952,9 @@ static void intel_pebs_aliases_skl(struct perf_event *event)
29522952
return intel_pebs_aliases_precdist(event);
29532953
}
29542954

2955-
static unsigned long intel_pmu_free_running_flags(struct perf_event *event)
2955+
static unsigned long intel_pmu_large_pebs_flags(struct perf_event *event)
29562956
{
2957-
unsigned long flags = x86_pmu.free_running_flags;
2957+
unsigned long flags = x86_pmu.large_pebs_flags;
29582958

29592959
if (event->attr.use_clockid)
29602960
flags &= ~PERF_SAMPLE_TIME;
@@ -2976,8 +2976,8 @@ static int intel_pmu_hw_config(struct perf_event *event)
29762976
if (!event->attr.freq) {
29772977
event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;
29782978
if (!(event->attr.sample_type &
2979-
~intel_pmu_free_running_flags(event)))
2980-
event->hw.flags |= PERF_X86_EVENT_FREERUNNING;
2979+
~intel_pmu_large_pebs_flags(event)))
2980+
event->hw.flags |= PERF_X86_EVENT_LARGE_PEBS;
29812981
}
29822982
if (x86_pmu.pebs_aliases)
29832983
x86_pmu.pebs_aliases(event);
@@ -3460,7 +3460,7 @@ static __initconst const struct x86_pmu core_pmu = {
34603460
.event_map = intel_pmu_event_map,
34613461
.max_events = ARRAY_SIZE(intel_perfmon_event_map),
34623462
.apic = 1,
3463-
.free_running_flags = PEBS_FREERUNNING_FLAGS,
3463+
.large_pebs_flags = LARGE_PEBS_FLAGS,
34643464

34653465
/*
34663466
* Intel PMCs cannot be accessed sanely above 32-bit width,
@@ -3502,7 +3502,7 @@ static __initconst const struct x86_pmu intel_pmu = {
35023502
.event_map = intel_pmu_event_map,
35033503
.max_events = ARRAY_SIZE(intel_perfmon_event_map),
35043504
.apic = 1,
3505-
.free_running_flags = PEBS_FREERUNNING_FLAGS,
3505+
.large_pebs_flags = LARGE_PEBS_FLAGS,
35063506
/*
35073507
* Intel PMCs cannot be accessed sanely above 32 bit width,
35083508
* so we install an artificial 1<<31 period regardless of

arch/x86/events/intel/ds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ void intel_pmu_pebs_add(struct perf_event *event)
935935
bool needed_cb = pebs_needs_sched_cb(cpuc);
936936

937937
cpuc->n_pebs++;
938-
if (hwc->flags & PERF_X86_EVENT_FREERUNNING)
938+
if (hwc->flags & PERF_X86_EVENT_LARGE_PEBS)
939939
cpuc->n_large_pebs++;
940940

941941
pebs_update_state(needed_cb, cpuc, event->ctx->pmu);
@@ -975,7 +975,7 @@ void intel_pmu_pebs_del(struct perf_event *event)
975975
bool needed_cb = pebs_needs_sched_cb(cpuc);
976976

977977
cpuc->n_pebs--;
978-
if (hwc->flags & PERF_X86_EVENT_FREERUNNING)
978+
if (hwc->flags & PERF_X86_EVENT_LARGE_PEBS)
979979
cpuc->n_large_pebs--;
980980

981981
pebs_update_state(needed_cb, cpuc, event->ctx->pmu);
@@ -1530,7 +1530,7 @@ void __init intel_ds_init(void)
15301530
x86_pmu.pebs_record_size =
15311531
sizeof(struct pebs_record_skl);
15321532
x86_pmu.drain_pebs = intel_pmu_drain_pebs_nhm;
1533-
x86_pmu.free_running_flags |= PERF_SAMPLE_TIME;
1533+
x86_pmu.large_pebs_flags |= PERF_SAMPLE_TIME;
15341534
break;
15351535

15361536
default:

arch/x86/events/perf_event.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct event_constraint {
6969
#define PERF_X86_EVENT_RDPMC_ALLOWED 0x0100 /* grant rdpmc permission */
7070
#define PERF_X86_EVENT_EXCL_ACCT 0x0200 /* accounted EXCL event */
7171
#define PERF_X86_EVENT_AUTO_RELOAD 0x0400 /* use PEBS auto-reload */
72-
#define PERF_X86_EVENT_FREERUNNING 0x0800 /* use freerunning PEBS */
72+
#define PERF_X86_EVENT_LARGE_PEBS 0x0800 /* use large PEBS */
7373

7474

7575
struct amd_nb {
@@ -88,7 +88,7 @@ struct amd_nb {
8888
* REGS_USER can be handled for events limited to ring 3.
8989
*
9090
*/
91-
#define PEBS_FREERUNNING_FLAGS \
91+
#define LARGE_PEBS_FLAGS \
9292
(PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_ADDR | \
9393
PERF_SAMPLE_ID | PERF_SAMPLE_CPU | PERF_SAMPLE_STREAM_ID | \
9494
PERF_SAMPLE_DATA_SRC | PERF_SAMPLE_IDENTIFIER | \
@@ -608,7 +608,7 @@ struct x86_pmu {
608608
struct event_constraint *pebs_constraints;
609609
void (*pebs_aliases)(struct perf_event *event);
610610
int max_pebs_events;
611-
unsigned long free_running_flags;
611+
unsigned long large_pebs_flags;
612612

613613
/*
614614
* Intel LBR

0 commit comments

Comments
 (0)