Skip to content

Commit cdd6c48

Browse files
author
Ingo Molnar
committed
perf: Do the big rename: Performance Counters -> Performance Events
Bye-bye Performance Counters, welcome Performance Events! In the past few months the perfcounters subsystem has grown out its initial role of counting hardware events, and has become (and is becoming) a much broader generic event enumeration, reporting, logging, monitoring, analysis facility. Naming its core object 'perf_counter' and naming the subsystem 'perfcounters' has become more and more of a misnomer. With pending code like hw-breakpoints support the 'counter' name is less and less appropriate. All in one, we've decided to rename the subsystem to 'performance events' and to propagate this rename through all fields, variables and API names. (in an ABI compatible fashion) The word 'event' is also a bit shorter than 'counter' - which makes it slightly more convenient to write/handle as well. Thanks goes to Stephane Eranian who first observed this misnomer and suggested a rename. User-space tooling and ABI compatibility is not affected - this patch should be function-invariant. (Also, defconfigs were not touched to keep the size down.) This patch has been generated via the following script: FILES=$(find * -type f | grep -vE 'oprofile|[^K]config') sed -i \ -e 's/PERF_EVENT_/PERF_RECORD_/g' \ -e 's/PERF_COUNTER/PERF_EVENT/g' \ -e 's/perf_counter/perf_event/g' \ -e 's/nb_counters/nb_events/g' \ -e 's/swcounter/swevent/g' \ -e 's/tpcounter_event/tp_event/g' \ $FILES for N in $(find . -name perf_counter.[ch]); do M=$(echo $N | sed 's/perf_counter/perf_event/g') mv $N $M done FILES=$(find . -name perf_event.*) sed -i \ -e 's/COUNTER_MASK/REG_MASK/g' \ -e 's/COUNTER/EVENT/g' \ -e 's/\<event\>/event_id/g' \ -e 's/counter/event/g' \ -e 's/Counter/Event/g' \ $FILES ... to keep it as correct as possible. This script can also be used by anyone who has pending perfcounters patches - it converts a Linux kernel tree over to the new naming. We tried to time this change to the point in time where the amount of pending patches is the smallest: the end of the merge window. Namespace clashes were fixed up in a preparatory patch - and some stylistic fallout will be fixed up in a subsequent patch. ( NOTE: 'counters' are still the proper terminology when we deal with hardware registers - and these sed scripts are a bit over-eager in renaming them. I've undone some of that, but in case there's something left where 'counter' would be better than 'event' we can undo that on an individual basis instead of touching an otherwise nicely automated patch. ) Suggested-by: Stephane Eranian <eranian@google.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Paul Mackerras <paulus@samba.org> Reviewed-by: Arjan van de Ven <arjan@linux.intel.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David Howells <dhowells@redhat.com> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: <linux-arch@vger.kernel.org> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent dfc6509 commit cdd6c48

File tree

132 files changed

+2452
-2452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+2452
-2452
lines changed

arch/arm/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@
390390
#define __NR_preadv (__NR_SYSCALL_BASE+361)
391391
#define __NR_pwritev (__NR_SYSCALL_BASE+362)
392392
#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
393-
#define __NR_perf_counter_open (__NR_SYSCALL_BASE+364)
393+
#define __NR_perf_event_open (__NR_SYSCALL_BASE+364)
394394

395395
/*
396396
* The following SWIs are ARM private.

arch/arm/kernel/calls.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@
373373
CALL(sys_preadv)
374374
CALL(sys_pwritev)
375375
CALL(sys_rt_tgsigqueueinfo)
376-
CALL(sys_perf_counter_open)
376+
CALL(sys_perf_event_open)
377377
#ifndef syscalls_counted
378378
.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
379379
#define syscalls_counted

arch/blackfin/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381
#define __NR_preadv 366
382382
#define __NR_pwritev 367
383383
#define __NR_rt_tgsigqueueinfo 368
384-
#define __NR_perf_counter_open 369
384+
#define __NR_perf_event_open 369
385385

386386
#define __NR_syscall 370
387387
#define NR_syscalls __NR_syscall

arch/blackfin/mach-common/entry.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1620,7 +1620,7 @@ ENTRY(_sys_call_table)
16201620
.long _sys_preadv
16211621
.long _sys_pwritev
16221622
.long _sys_rt_tgsigqueueinfo
1623-
.long _sys_perf_counter_open
1623+
.long _sys_perf_event_open
16241624

16251625
.rept NR_syscalls-(.-_sys_call_table)/4
16261626
.long _sys_ni_syscall

arch/frv/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config FRV
77
default y
88
select HAVE_IDE
99
select HAVE_ARCH_TRACEHOOK
10-
select HAVE_PERF_COUNTERS
10+
select HAVE_PERF_EVENTS
1111

1212
config ZONE_DMA
1313
bool
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* FRV performance counter support
1+
/* FRV performance event support
22
*
33
* Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
44
* Written by David Howells (dhowells@redhat.com)
@@ -9,9 +9,9 @@
99
* 2 of the Licence, or (at your option) any later version.
1010
*/
1111

12-
#ifndef _ASM_PERF_COUNTER_H
13-
#define _ASM_PERF_COUNTER_H
12+
#ifndef _ASM_PERF_EVENT_H
13+
#define _ASM_PERF_EVENT_H
1414

15-
#define PERF_COUNTER_INDEX_OFFSET 0
15+
#define PERF_EVENT_INDEX_OFFSET 0
1616

17-
#endif /* _ASM_PERF_COUNTER_H */
17+
#endif /* _ASM_PERF_EVENT_H */

arch/frv/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342
#define __NR_preadv 333
343343
#define __NR_pwritev 334
344344
#define __NR_rt_tgsigqueueinfo 335
345-
#define __NR_perf_counter_open 336
345+
#define __NR_perf_event_open 336
346346

347347
#ifdef __KERNEL__
348348

arch/frv/kernel/entry.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,6 @@ sys_call_table:
15251525
.long sys_preadv
15261526
.long sys_pwritev
15271527
.long sys_rt_tgsigqueueinfo /* 335 */
1528-
.long sys_perf_counter_open
1528+
.long sys_perf_event_open
15291529

15301530
syscall_table_size = (. - sys_call_table)

arch/frv/lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
lib-y := \
66
__ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o __ucmpdi2.o \
77
checksum.o memcpy.o memset.o atomic-ops.o atomic64-ops.o \
8-
outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o perf_counter.o
8+
outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o perf_event.o
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Performance counter handling
1+
/* Performance event handling
22
*
33
* Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
44
* Written by David Howells (dhowells@redhat.com)
@@ -9,11 +9,11 @@
99
* 2 of the Licence, or (at your option) any later version.
1010
*/
1111

12-
#include <linux/perf_counter.h>
12+
#include <linux/perf_event.h>
1313

1414
/*
15-
* mark the performance counter as pending
15+
* mark the performance event as pending
1616
*/
17-
void set_perf_counter_pending(void)
17+
void set_perf_event_pending(void)
1818
{
1919
}

arch/m68k/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
#define __NR_preadv 329
336336
#define __NR_pwritev 330
337337
#define __NR_rt_tgsigqueueinfo 331
338-
#define __NR_perf_counter_open 332
338+
#define __NR_perf_event_open 332
339339

340340
#ifdef __KERNEL__
341341

arch/m68k/kernel/entry.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,5 +756,5 @@ sys_call_table:
756756
.long sys_preadv
757757
.long sys_pwritev /* 330 */
758758
.long sys_rt_tgsigqueueinfo
759-
.long sys_perf_counter_open
759+
.long sys_perf_event_open
760760

arch/m68knommu/kernel/syscalltable.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ ENTRY(sys_call_table)
350350
.long sys_preadv
351351
.long sys_pwritev /* 330 */
352352
.long sys_rt_tgsigqueueinfo
353-
.long sys_perf_counter_open
353+
.long sys_perf_event_open
354354

355355
.rept NR_syscalls-(.-sys_call_table)/4
356356
.long sys_ni_syscall

arch/microblaze/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381
#define __NR_preadv 363 /* new */
382382
#define __NR_pwritev 364 /* new */
383383
#define __NR_rt_tgsigqueueinfo 365 /* new */
384-
#define __NR_perf_counter_open 366 /* new */
384+
#define __NR_perf_event_open 366 /* new */
385385

386386
#define __NR_syscalls 367
387387

arch/microblaze/kernel/syscall_table.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,4 +370,4 @@ ENTRY(sys_call_table)
370370
.long sys_ni_syscall
371371
.long sys_ni_syscall
372372
.long sys_rt_tgsigqueueinfo /* 365 */
373-
.long sys_perf_counter_open
373+
.long sys_perf_event_open

arch/mips/include/asm/unistd.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
#define __NR_preadv (__NR_Linux + 330)
354354
#define __NR_pwritev (__NR_Linux + 331)
355355
#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
356-
#define __NR_perf_counter_open (__NR_Linux + 333)
356+
#define __NR_perf_event_open (__NR_Linux + 333)
357357
#define __NR_accept4 (__NR_Linux + 334)
358358

359359
/*
@@ -664,7 +664,7 @@
664664
#define __NR_preadv (__NR_Linux + 289)
665665
#define __NR_pwritev (__NR_Linux + 290)
666666
#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
667-
#define __NR_perf_counter_open (__NR_Linux + 292)
667+
#define __NR_perf_event_open (__NR_Linux + 292)
668668
#define __NR_accept4 (__NR_Linux + 293)
669669

670670
/*
@@ -979,7 +979,7 @@
979979
#define __NR_preadv (__NR_Linux + 293)
980980
#define __NR_pwritev (__NR_Linux + 294)
981981
#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
982-
#define __NR_perf_counter_open (__NR_Linux + 296)
982+
#define __NR_perf_event_open (__NR_Linux + 296)
983983
#define __NR_accept4 (__NR_Linux + 297)
984984

985985
/*

arch/mips/kernel/scall32-o32.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ einval: li v0, -ENOSYS
581581
sys sys_preadv 6 /* 4330 */
582582
sys sys_pwritev 6
583583
sys sys_rt_tgsigqueueinfo 4
584-
sys sys_perf_counter_open 5
584+
sys sys_perf_event_open 5
585585
sys sys_accept4 4
586586
.endm
587587

arch/mips/kernel/scall64-64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,6 @@ sys_call_table:
418418
PTR sys_preadv
419419
PTR sys_pwritev /* 5390 */
420420
PTR sys_rt_tgsigqueueinfo
421-
PTR sys_perf_counter_open
421+
PTR sys_perf_event_open
422422
PTR sys_accept4
423423
.size sys_call_table,.-sys_call_table

arch/mips/kernel/scall64-n32.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,6 @@ EXPORT(sysn32_call_table)
416416
PTR sys_preadv
417417
PTR sys_pwritev
418418
PTR compat_sys_rt_tgsigqueueinfo /* 5295 */
419-
PTR sys_perf_counter_open
419+
PTR sys_perf_event_open
420420
PTR sys_accept4
421421
.size sysn32_call_table,.-sysn32_call_table

arch/mips/kernel/scall64-o32.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,6 @@ sys_call_table:
536536
PTR compat_sys_preadv /* 4330 */
537537
PTR compat_sys_pwritev
538538
PTR compat_sys_rt_tgsigqueueinfo
539-
PTR sys_perf_counter_open
539+
PTR sys_perf_event_open
540540
PTR sys_accept4
541541
.size sys_call_table,.-sys_call_table

arch/mn10300/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
#define __NR_preadv 334
348348
#define __NR_pwritev 335
349349
#define __NR_rt_tgsigqueueinfo 336
350-
#define __NR_perf_counter_open 337
350+
#define __NR_perf_event_open 337
351351

352352
#ifdef __KERNEL__
353353

arch/mn10300/kernel/entry.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ ENTRY(sys_call_table)
723723
.long sys_preadv
724724
.long sys_pwritev /* 335 */
725725
.long sys_rt_tgsigqueueinfo
726-
.long sys_perf_counter_open
726+
.long sys_perf_event_open
727727

728728

729729
nr_syscalls=(.-sys_call_table)/4

arch/parisc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ config PARISC
1616
select RTC_DRV_GENERIC
1717
select INIT_ALL_POSSIBLE
1818
select BUG
19-
select HAVE_PERF_COUNTERS
19+
select HAVE_PERF_EVENTS
2020
select GENERIC_ATOMIC64 if !64BIT
2121
help
2222
The PA-RISC microprocessor is designed by Hewlett-Packard and used

arch/parisc/include/asm/perf_counter.h

Lines changed: 0 additions & 7 deletions
This file was deleted.

arch/parisc/include/asm/perf_event.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef __ASM_PARISC_PERF_EVENT_H
2+
#define __ASM_PARISC_PERF_EVENT_H
3+
4+
/* parisc only supports software events through this interface. */
5+
static inline void set_perf_event_pending(void) { }
6+
7+
#endif /* __ASM_PARISC_PERF_EVENT_H */

arch/parisc/include/asm/unistd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,9 +810,9 @@
810810
#define __NR_preadv (__NR_Linux + 315)
811811
#define __NR_pwritev (__NR_Linux + 316)
812812
#define __NR_rt_tgsigqueueinfo (__NR_Linux + 317)
813-
#define __NR_perf_counter_open (__NR_Linux + 318)
813+
#define __NR_perf_event_open (__NR_Linux + 318)
814814

815-
#define __NR_Linux_syscalls (__NR_perf_counter_open + 1)
815+
#define __NR_Linux_syscalls (__NR_perf_event_open + 1)
816816

817817

818818
#define __IGNORE_select /* newselect */

arch/parisc/kernel/syscall_table.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@
416416
ENTRY_COMP(preadv) /* 315 */
417417
ENTRY_COMP(pwritev)
418418
ENTRY_COMP(rt_tgsigqueueinfo)
419-
ENTRY_SAME(perf_counter_open)
419+
ENTRY_SAME(perf_event_open)
420420

421421
/* Nothing yet */
422422

arch/powerpc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ config PPC
129129
select HAVE_OPROFILE
130130
select HAVE_SYSCALL_WRAPPERS if PPC64
131131
select GENERIC_ATOMIC64 if PPC32
132-
select HAVE_PERF_COUNTERS
132+
select HAVE_PERF_EVENTS
133133

134134
config EARLY_PRINTK
135135
bool

arch/powerpc/include/asm/hw_irq.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,43 +135,43 @@ static inline int irqs_disabled_flags(unsigned long flags)
135135
*/
136136
struct irq_chip;
137137

138-
#ifdef CONFIG_PERF_COUNTERS
138+
#ifdef CONFIG_PERF_EVENTS
139139

140140
#ifdef CONFIG_PPC64
141-
static inline unsigned long test_perf_counter_pending(void)
141+
static inline unsigned long test_perf_event_pending(void)
142142
{
143143
unsigned long x;
144144

145145
asm volatile("lbz %0,%1(13)"
146146
: "=r" (x)
147-
: "i" (offsetof(struct paca_struct, perf_counter_pending)));
147+
: "i" (offsetof(struct paca_struct, perf_event_pending)));
148148
return x;
149149
}
150150

151-
static inline void set_perf_counter_pending(void)
151+
static inline void set_perf_event_pending(void)
152152
{
153153
asm volatile("stb %0,%1(13)" : :
154154
"r" (1),
155-
"i" (offsetof(struct paca_struct, perf_counter_pending)));
155+
"i" (offsetof(struct paca_struct, perf_event_pending)));
156156
}
157157

158-
static inline void clear_perf_counter_pending(void)
158+
static inline void clear_perf_event_pending(void)
159159
{
160160
asm volatile("stb %0,%1(13)" : :
161161
"r" (0),
162-
"i" (offsetof(struct paca_struct, perf_counter_pending)));
162+
"i" (offsetof(struct paca_struct, perf_event_pending)));
163163
}
164164
#endif /* CONFIG_PPC64 */
165165

166-
#else /* CONFIG_PERF_COUNTERS */
166+
#else /* CONFIG_PERF_EVENTS */
167167

168-
static inline unsigned long test_perf_counter_pending(void)
168+
static inline unsigned long test_perf_event_pending(void)
169169
{
170170
return 0;
171171
}
172172

173-
static inline void clear_perf_counter_pending(void) {}
174-
#endif /* CONFIG_PERF_COUNTERS */
173+
static inline void clear_perf_event_pending(void) {}
174+
#endif /* CONFIG_PERF_EVENTS */
175175

176176
#endif /* __KERNEL__ */
177177
#endif /* _ASM_POWERPC_HW_IRQ_H */

arch/powerpc/include/asm/paca.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ struct paca_struct {
122122
u8 soft_enabled; /* irq soft-enable flag */
123123
u8 hard_enabled; /* set if irqs are enabled in MSR */
124124
u8 io_sync; /* writel() needs spin_unlock sync */
125-
u8 perf_counter_pending; /* PM interrupt while soft-disabled */
125+
u8 perf_event_pending; /* PM interrupt while soft-disabled */
126126

127127
/* Stuff for accurate time accounting */
128128
u64 user_time; /* accumulated usermode TB ticks */

0 commit comments

Comments
 (0)