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

132 files changed

Lines changed: 2452 additions & 2452 deletions

File tree

Some content is hidden

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

‎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
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
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
}

0 commit comments

Comments
 (0)