Re: [tree] Performance Counters for Linux, v7

From: Jaswinder Singh Rajput
Date: Sun Mar 22 2009 - 02:50:28 EST


On Sat, 2009-03-21 at 17:10 +0100, Ingo Molnar wrote:

> There's also been lots of updates to the userspace tools (kerneltop
> and perfstat):
>
> http://redhat.com/~mingo/perfcounters/kerneltop.c
> http://redhat.com/~mingo/perfcounters/perfstat.c
>

If possible, can we also prepare git tree for these userspace tools by
this way we can also look on logs and check incremental changes
otherwise we leads to:

[jaswinder@hpdv5 20090321]$ cc -O2 -g -lrt -Wall -W -o perfstat perfstat.c
perfstat.c:57:40: error: include/linux/perf_counter.h: No such file or directory
perfstat.c:83: warning: âstruct perf_counter_hw_eventâ declared inside parameter list
perfstat.c:83: warning: its scope is only this definition or declaration, which is probably not what you want
perfstat.c:127: error: âPERF_TYPE_SOFTWAREâ undeclared here (not in a function)
perfstat.c:127: error: âPERF_COUNT_TASK_CLOCKâ undeclared here (not in a function)
perfstat.c:128: error: âPERF_COUNT_CPU_MIGRATIONSâ undeclared here (not in a function)
perfstat.c:129: error: âPERF_COUNT_CONTEXT_SWITCHESâ undeclared here (not in a function)
perfstat.c:130: error: âPERF_COUNT_PAGE_FAULTSâ undeclared here (not in a function)
perfstat.c:131: error: âPERF_TYPE_HARDWAREâ undeclared here (not in a function)
perfstat.c:131: error: âPERF_COUNT_CPU_CYCLESâ undeclared here (not in a function)
perfstat.c:132: error: âPERF_COUNT_INSTRUCTIONSâ undeclared here (not in a function)
perfstat.c:133: error: âPERF_COUNT_CACHE_REFERENCESâ undeclared here (not in a function)
perfstat.c:134: error: âPERF_COUNT_CACHE_MISSESâ undeclared here (not in a function)
perfstat.c: In function âtype_validâ:
perfstat.c:164: error: âPERF_HW_EVENTS_MAXâ undeclared (first use in this function)
perfstat.c:164: error: (Each undeclared identifier is reported only once
perfstat.c:164: error: for each function it appears in.)
perfstat.c:166: error: âPERF_SW_EVENTS_MAXâ undeclared (first use in this function)
perfstat.c:167: error: âPERF_TYPE_TRACEPOINTâ undeclared (first use in this function)
perfstat.c: In function âevent_nameâ:
perfstat.c:194: error: âPERF_TYPE_TRACEPOINTâ undeclared (first use in this function)
perfstat.c: In function âcreate_counterâ:
perfstat.c:286: error: storage size of âhw_eventâ isnât known
perfstat.c:290: error: âPERF_RECORD_SIMPLEâ undeclared (first use in this function)
perfstat.c:286: warning: unused variable âhw_eventâ
perfstat.c: In function âmainâ:
perfstat.c:385: error: âPERF_COUNT_CPU_CLOCKâ undeclared (first use in this function)
[jaswinder@hpdv5 20090321]$
[jaswinder@hpdv5 20090321]$ cc -O2 -g -lrt -Wall -W -o perfstat perfstat.c -I/home/jaswinder/jaswinder-git/linux-2.6-tip
[jaswinder@hpdv5 20090321]$ ./perfstat -e 1 -e 3 -e 5 ls -lR /usr/include/
Usage: perfstat [<events...>] <cmd...>

PerfStat Options (up to 64 event types can be specified):

-e EID --event_id=EID # event type ID
0: CPU cycles
1: instructions
2: cache accesses
3: cache misses
4: branch instructions
5: branch prediction misses
6: bus cycles

-s # system-wide collection

-c <cmd..> --command=<cmd..> # command+arguments to be timed.

[jaswinder@hpdv5 20090321]$ ./perfstat -e 0,1,2 -c ls
Usage: perfstat [<events...>] <cmd...>

PerfStat Options (up to 64 event types can be specified):

-e EID --event_id=EID # event type ID
0: CPU cycles
1: instructions
2: cache accesses
3: cache misses
4: branch instructions
5: branch prediction misses
6: bus cycles

-s # system-wide collection

-c <cmd..> --command=<cmd..> # command+arguments to be timed.

[jaswinder@hpdv5 20090321]$

Thanks,

--
JSR

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/