aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-09-21 06:02:48 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-21 08:28:04 -0400
commitcdd6c482c9ff9c55475ee7392ec8f672eddb7be6 (patch)
tree81f98a3ab46c589792057fe2392c1e10f8ad7893 /tools/perf/builtin-report.c
parentdfc65094d0313cc48969fa60bcf33d693aeb05a7 (diff)
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>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index cdf9a8d27bb..19669c20088 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1121,7 +1121,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1121 more_data += sizeof(u64); 1121 more_data += sizeof(u64);
1122 } 1122 }
1123 1123
1124 dump_printf("%p [%p]: PERF_EVENT_SAMPLE (IP, %d): %d/%d: %p period: %Ld\n", 1124 dump_printf("%p [%p]: PERF_RECORD_SAMPLE (IP, %d): %d/%d: %p period: %Ld\n",
1125 (void *)(offset + head), 1125 (void *)(offset + head),
1126 (void *)(long)(event->header.size), 1126 (void *)(long)(event->header.size),
1127 event->header.misc, 1127 event->header.misc,
@@ -1158,9 +1158,9 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1158 if (comm_list && !strlist__has_entry(comm_list, thread->comm)) 1158 if (comm_list && !strlist__has_entry(comm_list, thread->comm))
1159 return 0; 1159 return 0;
1160 1160
1161 cpumode = event->header.misc & PERF_EVENT_MISC_CPUMODE_MASK; 1161 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
1162 1162
1163 if (cpumode == PERF_EVENT_MISC_KERNEL) { 1163 if (cpumode == PERF_RECORD_MISC_KERNEL) {
1164 show = SHOW_KERNEL; 1164 show = SHOW_KERNEL;
1165 level = 'k'; 1165 level = 'k';
1166 1166
@@ -1168,7 +1168,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1168 1168
1169 dump_printf(" ...... dso: %s\n", dso->name); 1169 dump_printf(" ...... dso: %s\n", dso->name);
1170 1170
1171 } else if (cpumode == PERF_EVENT_MISC_USER) { 1171 } else if (cpumode == PERF_RECORD_MISC_USER) {
1172 1172
1173 show = SHOW_USER; 1173 show = SHOW_USER;
1174 level = '.'; 1174 level = '.';
@@ -1210,7 +1210,7 @@ process_mmap_event(event_t *event, unsigned long offset, unsigned long head)
1210 1210
1211 thread = threads__findnew(event->mmap.pid, &threads, &last_match); 1211 thread = threads__findnew(event->mmap.pid, &threads, &last_match);
1212 1212
1213 dump_printf("%p [%p]: PERF_EVENT_MMAP %d/%d: [%p(%p) @ %p]: %s\n", 1213 dump_printf("%p [%p]: PERF_RECORD_MMAP %d/%d: [%p(%p) @ %p]: %s\n",
1214 (void *)(offset + head), 1214 (void *)(offset + head),
1215 (void *)(long)(event->header.size), 1215 (void *)(long)(event->header.size),
1216 event->mmap.pid, 1216 event->mmap.pid,
@@ -1221,7 +1221,7 @@ process_mmap_event(event_t *event, unsigned long offset, unsigned long head)
1221 event->mmap.filename); 1221 event->mmap.filename);
1222 1222
1223 if (thread == NULL || map == NULL) { 1223 if (thread == NULL || map == NULL) {
1224 dump_printf("problem processing PERF_EVENT_MMAP, skipping event.\n"); 1224 dump_printf("problem processing PERF_RECORD_MMAP, skipping event.\n");
1225 return 0; 1225 return 0;
1226 } 1226 }
1227 1227
@@ -1238,14 +1238,14 @@ process_comm_event(event_t *event, unsigned long offset, unsigned long head)
1238 1238
1239 thread = threads__findnew(event->comm.pid, &threads, &last_match); 1239 thread = threads__findnew(event->comm.pid, &threads, &last_match);
1240 1240
1241 dump_printf("%p [%p]: PERF_EVENT_COMM: %s:%d\n", 1241 dump_printf("%p [%p]: PERF_RECORD_COMM: %s:%d\n",
1242 (void *)(offset + head), 1242 (void *)(offset + head),
1243 (void *)(long)(event->header.size), 1243 (void *)(long)(event->header.size),
1244 event->comm.comm, event->comm.pid); 1244 event->comm.comm, event->comm.pid);
1245 1245
1246 if (thread == NULL || 1246 if (thread == NULL ||
1247 thread__set_comm_adjust(thread, event->comm.comm)) { 1247 thread__set_comm_adjust(thread, event->comm.comm)) {
1248 dump_printf("problem processing PERF_EVENT_COMM, skipping event.\n"); 1248 dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n");
1249 return -1; 1249 return -1;
1250 } 1250 }
1251 total_comm++; 1251 total_comm++;
@@ -1262,10 +1262,10 @@ process_task_event(event_t *event, unsigned long offset, unsigned long head)
1262 thread = threads__findnew(event->fork.pid, &threads, &last_match); 1262 thread = threads__findnew(event->fork.pid, &threads, &last_match);
1263 parent = threads__findnew(event->fork.ppid, &threads, &last_match); 1263 parent = threads__findnew(event->fork.ppid, &threads, &last_match);
1264 1264
1265 dump_printf("%p [%p]: PERF_EVENT_%s: (%d:%d):(%d:%d)\n", 1265 dump_printf("%p [%p]: PERF_RECORD_%s: (%d:%d):(%d:%d)\n",
1266 (void *)(offset + head), 1266 (void *)(offset + head),
1267 (void *)(long)(event->header.size), 1267 (void *)(long)(event->header.size),
1268 event->header.type == PERF_EVENT_FORK ? "FORK" : "EXIT", 1268 event->header.type == PERF_RECORD_FORK ? "FORK" : "EXIT",
1269 event->fork.pid, event->fork.tid, 1269 event->fork.pid, event->fork.tid,
1270 event->fork.ppid, event->fork.ptid); 1270 event->fork.ppid, event->fork.ptid);
1271 1271
@@ -1276,11 +1276,11 @@ process_task_event(event_t *event, unsigned long offset, unsigned long head)
1276 if (thread == parent) 1276 if (thread == parent)
1277 return 0; 1277 return 0;
1278 1278
1279 if (event->header.type == PERF_EVENT_EXIT) 1279 if (event->header.type == PERF_RECORD_EXIT)
1280 return 0; 1280 return 0;
1281 1281
1282 if (!thread || !parent || thread__fork(thread, parent)) { 1282 if (!thread || !parent || thread__fork(thread, parent)) {
1283 dump_printf("problem processing PERF_EVENT_FORK, skipping event.\n"); 1283 dump_printf("problem processing PERF_RECORD_FORK, skipping event.\n");
1284 return -1; 1284 return -1;
1285 } 1285 }
1286 total_fork++; 1286 total_fork++;
@@ -1291,7 +1291,7 @@ process_task_event(event_t *event, unsigned long offset, unsigned long head)
1291static int 1291static int
1292process_lost_event(event_t *event, unsigned long offset, unsigned long head) 1292process_lost_event(event_t *event, unsigned long offset, unsigned long head)
1293{ 1293{
1294 dump_printf("%p [%p]: PERF_EVENT_LOST: id:%Ld: lost:%Ld\n", 1294 dump_printf("%p [%p]: PERF_RECORD_LOST: id:%Ld: lost:%Ld\n",
1295 (void *)(offset + head), 1295 (void *)(offset + head),
1296 (void *)(long)(event->header.size), 1296 (void *)(long)(event->header.size),
1297 event->lost.id, 1297 event->lost.id,
@@ -1305,7 +1305,7 @@ process_lost_event(event_t *event, unsigned long offset, unsigned long head)
1305static int 1305static int
1306process_read_event(event_t *event, unsigned long offset, unsigned long head) 1306process_read_event(event_t *event, unsigned long offset, unsigned long head)
1307{ 1307{
1308 struct perf_counter_attr *attr; 1308 struct perf_event_attr *attr;
1309 1309
1310 attr = perf_header__find_attr(event->read.id, header); 1310 attr = perf_header__find_attr(event->read.id, header);
1311 1311
@@ -1319,7 +1319,7 @@ process_read_event(event_t *event, unsigned long offset, unsigned long head)
1319 event->read.value); 1319 event->read.value);
1320 } 1320 }
1321 1321
1322 dump_printf("%p [%p]: PERF_EVENT_READ: %d %d %s %Lu\n", 1322 dump_printf("%p [%p]: PERF_RECORD_READ: %d %d %s %Lu\n",
1323 (void *)(offset + head), 1323 (void *)(offset + head),
1324 (void *)(long)(event->header.size), 1324 (void *)(long)(event->header.size),
1325 event->read.pid, 1325 event->read.pid,
@@ -1337,31 +1337,31 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
1337 trace_event(event); 1337 trace_event(event);
1338 1338
1339 switch (event->header.type) { 1339 switch (event->header.type) {
1340 case PERF_EVENT_SAMPLE: 1340 case PERF_RECORD_SAMPLE:
1341 return process_sample_event(event, offset, head); 1341 return process_sample_event(event, offset, head);
1342 1342
1343 case PERF_EVENT_MMAP: 1343 case PERF_RECORD_MMAP:
1344 return process_mmap_event(event, offset, head); 1344 return process_mmap_event(event, offset, head);
1345 1345
1346 case PERF_EVENT_COMM: 1346 case PERF_RECORD_COMM:
1347 return process_comm_event(event, offset, head); 1347 return process_comm_event(event, offset, head);
1348 1348
1349 case PERF_EVENT_FORK: 1349 case PERF_RECORD_FORK:
1350 case PERF_EVENT_EXIT: 1350 case PERF_RECORD_EXIT:
1351 return process_task_event(event, offset, head); 1351 return process_task_event(event, offset, head);
1352 1352
1353 case PERF_EVENT_LOST: 1353 case PERF_RECORD_LOST:
1354 return process_lost_event(event, offset, head); 1354 return process_lost_event(event, offset, head);
1355 1355
1356 case PERF_EVENT_READ: 1356 case PERF_RECORD_READ:
1357 return process_read_event(event, offset, head); 1357 return process_read_event(event, offset, head);
1358 1358
1359 /* 1359 /*
1360 * We dont process them right now but they are fine: 1360 * We dont process them right now but they are fine:
1361 */ 1361 */
1362 1362
1363 case PERF_EVENT_THROTTLE: 1363 case PERF_RECORD_THROTTLE:
1364 case PERF_EVENT_UNTHROTTLE: 1364 case PERF_RECORD_UNTHROTTLE:
1365 return 0; 1365 return 0;
1366 1366
1367 default: 1367 default: