mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
perf_counter tools: Clean up old kerneltop references
kerneltop has been replaced with perf top - so fix up a few remaining references to it in display text and error messages. Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
a96bbc1641
commit
f2521b6e4c
2 changed files with 9 additions and 11 deletions
|
@ -357,7 +357,8 @@ static void open_counters(int cpu, pid_t pid)
|
||||||
|
|
||||||
if (fd[nr_cpu][counter] < 0) {
|
if (fd[nr_cpu][counter] < 0) {
|
||||||
int err = errno;
|
int err = errno;
|
||||||
printf("kerneltop error: syscall returned with %d (%s)\n",
|
|
||||||
|
error("syscall returned with %d (%s)\n",
|
||||||
fd[nr_cpu][counter], strerror(err));
|
fd[nr_cpu][counter], strerror(err));
|
||||||
if (err == EPERM)
|
if (err == EPERM)
|
||||||
printf("Are you root?\n");
|
printf("Are you root?\n");
|
||||||
|
@ -382,8 +383,7 @@ static void open_counters(int cpu, pid_t pid)
|
||||||
mmap_array[nr_cpu][counter].base = mmap(NULL, (mmap_pages+1)*page_size,
|
mmap_array[nr_cpu][counter].base = mmap(NULL, (mmap_pages+1)*page_size,
|
||||||
PROT_READ, MAP_SHARED, fd[nr_cpu][counter], 0);
|
PROT_READ, MAP_SHARED, fd[nr_cpu][counter], 0);
|
||||||
if (mmap_array[nr_cpu][counter].base == MAP_FAILED) {
|
if (mmap_array[nr_cpu][counter].base == MAP_FAILED) {
|
||||||
printf("kerneltop error: failed to mmap with %d (%s)\n",
|
error("failed to mmap with %d (%s)\n", errno, strerror(errno));
|
||||||
errno, strerror(errno));
|
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@ static void print_sym_table(void)
|
||||||
|
|
||||||
printf(
|
printf(
|
||||||
"------------------------------------------------------------------------------\n");
|
"------------------------------------------------------------------------------\n");
|
||||||
printf( " KernelTop:%8.0f irqs/sec kernel:%4.1f%% [",
|
printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% [",
|
||||||
events_per_sec,
|
events_per_sec,
|
||||||
100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec)));
|
100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec)));
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ static void print_sym_table(void)
|
||||||
|
|
||||||
static void *display_thread(void *arg)
|
static void *display_thread(void *arg)
|
||||||
{
|
{
|
||||||
printf("KernelTop refresh period: %d seconds\n", delay_secs);
|
printf("PerfTop refresh period: %d seconds\n", delay_secs);
|
||||||
|
|
||||||
while (!sleep(delay_secs))
|
while (!sleep(delay_secs))
|
||||||
print_sym_table();
|
print_sym_table();
|
||||||
|
@ -564,7 +564,8 @@ static int __cmd_top(void)
|
||||||
fd[i][counter] = sys_perf_counter_open(&attr, target_pid, cpu, group_fd, 0);
|
fd[i][counter] = sys_perf_counter_open(&attr, target_pid, cpu, group_fd, 0);
|
||||||
if (fd[i][counter] < 0) {
|
if (fd[i][counter] < 0) {
|
||||||
int err = errno;
|
int err = errno;
|
||||||
printf("kerneltop error: syscall returned with %d (%s)\n",
|
|
||||||
|
error("syscall returned with %d (%s)\n",
|
||||||
fd[i][counter], strerror(err));
|
fd[i][counter], strerror(err));
|
||||||
if (err == EPERM)
|
if (err == EPERM)
|
||||||
printf("Are you root?\n");
|
printf("Are you root?\n");
|
||||||
|
@ -588,11 +589,8 @@ static int __cmd_top(void)
|
||||||
mmap_array[i][counter].mask = mmap_pages*page_size - 1;
|
mmap_array[i][counter].mask = mmap_pages*page_size - 1;
|
||||||
mmap_array[i][counter].base = mmap(NULL, (mmap_pages+1)*page_size,
|
mmap_array[i][counter].base = mmap(NULL, (mmap_pages+1)*page_size,
|
||||||
PROT_READ, MAP_SHARED, fd[i][counter], 0);
|
PROT_READ, MAP_SHARED, fd[i][counter], 0);
|
||||||
if (mmap_array[i][counter].base == MAP_FAILED) {
|
if (mmap_array[i][counter].base == MAP_FAILED)
|
||||||
printf("kerneltop error: failed to mmap with %d (%s)\n",
|
die("failed to mmap with %d (%s)\n", errno, strerror(errno));
|
||||||
errno, strerror(errno));
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue