perf tools: fix incorrect header string
PATCH 1/1 perf tools: fix incorrect header string
Commit fbe96f29 (perf tools: Make perf.data more self-descriptive) read '/proc/cpuinfo' to form cpu descriptor. For ARM, it finds 'Processor' field. It is correct when the patch merged, but due to commit b4b8f770 (ARM: kernel: update cpuinfo to print all online CPUs features), the corresponding information becomes 'model name' field.
This patch simply corrects it.
--- tools/perf/perf-sys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/perf-sys.h +1 -1
@@ -113,7 +113,7 @@#define mb () ((void(*)(void))0xffff0fa0)()#define wmb () ((void(*)(void))0xffff0fa0)()#define rmb () ((void(*)(void))0xffff0fa0)() -#define CPUINFO_PROC "Processor" +#define CPUINFO_PROC "model name"#endif #ifdef __aarch64__
Signature · 1 line
1.8.4
Arnaldo Carvalho de Melo
maintainerEm Wed, Oct 15, 2014 at 11:28:53AM +0800, Wang Nan escreveu:
Quoted 7 lines
Commit
fbe96f29(perf tools: Make perf.data more self-descriptive) read '/proc/cpuinfo' to form cpu descriptor. For ARM, it finds 'Processor' field. It is correct when the patch merged, but due to commitb4b8f770(ARM: kernel: update cpuinfo to print all online CPUs features), the corresponding information becomes 'model name' field.This patch simply corrects it.
It doesn't :-)
It makes it work with kernels >= b4b8f770, and fail with older kernels.
We need to somehow figure out where the right information is regardless of the kernel.
- Arnaldo
Quoted 20 lines
Signed-off-by Wang Nan <[email protected]>--- tools/perf/perf-sys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/perf-sys.h +1
-1@@ -113,7 +113,7 @@#define mb () ((void(*)(void))0xffff0fa0)()#define wmb () ((void(*)(void))0xffff0fa0)()#define rmb () ((void(*)(void))0xffff0fa0)() -#define CPUINFO_PROC "Processor" +#define CPUINFO_PROC "model name"#endif #ifdef __aarch64__Signature · 1 line
1.8.4
Quoted 9 lines · Arnaldo Carvalho de Melo
Em Wed, Oct 15, 2014 at 11:28:53AM +0800, Wang Nan escreveu:
Quoted 7 lines
Commit
fbe96f29(perf tools: Make perf.data more self-descriptive) read '/proc/cpuinfo' to form cpu descriptor. For ARM, it finds 'Processor' field. It is correct when the patch merged, but due to commitb4b8f770(ARM: kernel: update cpuinfo to print all online CPUs features), the corresponding information becomes 'model name' field.This patch simply corrects it.
Quoted 9 lines
It doesn't :-)
It makes it work with kernels >=
b4b8f770, and fail with older kernels.We need to somehow figure out where the right information is regardless of the kernel.
- Arnaldo
However it is a real problem. Look at output on arm platform at the bottom of this mail, especially "cpudesc", "total memory" and "cmdline" field.
By further debugging I found that the real problem resides in return value checking when write header error. Please see my other patches:
https://lkml.org/lkml/2014/10/15/612
https://lkml.org/lkml/2014/10/15/611
I think at least one of them is required.
Thanks.
Quoted 17 lines
Quoted 17 lines
Signed-off-by Wang Nan <[email protected]>--- tools/perf/perf-sys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/perf-sys.h +1
-1@@ -113,7 +113,7 @@#define mb () ((void(*)(void))0xffff0fa0)()#define wmb () ((void(*)(void))0xffff0fa0)()#define rmb () ((void(*)(void))0xffff0fa0)() -#define CPUINFO_PROC "Processor" +#define CPUINFO_PROC "model name"#endif
Quoted 3 lines
Quoted 3 lines
tools/perf/perf-sys.h +0
-0#ifdef __aarch64__Signature · 1 line
1.8.4
bash-4.2# perf record ls
...
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.001 MB perf.data (~36 samples) ] bash-4.2# perf report --stdio --header
Error:
The perf.data file has no samples!
# ========
# captured on: Fri Sep 12 10:09:10 2014 # hostname : arma15el # os release : 3.17.0+ # perf version : 3.10.53 # arch : armv7l # nrcpus online : 4 # nrcpus avail : 1 # cpudesc : (null) # total memory : 0 kB # cmdline : # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0 # pmu mappings: not available # ======== #
Arnaldo Carvalho de Melo
maintainerEm Thu, Oct 16, 2014 at 11:21:13AM +0800, Wang Nan escreveu:
Quoted 14 lines · Arnaldo Carvalho de Melo
Quoted 13 lines
Em Wed, Oct 15, 2014 at 11:28:53AM +0800, Wang Nan escreveu:
Quoted 7 lines
Commit
fbe96f29(perf tools: Make perf.data more self-descriptive) read '/proc/cpuinfo' to form cpu descriptor. For ARM, it finds 'Processor' field. It is correct when the patch merged, but due to commitb4b8f770(ARM: kernel: update cpuinfo to print all online CPUs features), the corresponding information becomes 'model name' field.This patch simply corrects it.
It doesn't :-)
It makes it work with kernels >=
b4b8f770, and fail with older kernels.
Quoted 8 lines
Quoted 5 lines
We need to somehow figure out where the right information is regardless of the kernel.
- Arnaldo
However it is a real problem. Look at output on arm platform at the bottom of this mail, especially "cpudesc", "total memory" and "cmdline" field.
Yeah, I haven't said it wasn't a problem, just that the proposed fix wasn't enough.
- Arnaldo
Quoted 57 lines
By further debugging I found that the real problem resides in return value checking when write header error. Please see my other patches:
https://lkml.org/lkml/2014/10/15/612
https://lkml.org/lkml/2014/10/15/611I think at least one of them is required.
Thanks.
Quoted 17 lines
Quoted 17 lines
Signed-off-by Wang Nan <[email protected]>--- tools/perf/perf-sys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/perf-sys.h +1
-1@@ -113,7 +113,7 @@#define mb () ((void(*)(void))0xffff0fa0)()#define wmb () ((void(*)(void))0xffff0fa0)()#define rmb () ((void(*)(void))0xffff0fa0)() -#define CPUINFO_PROC "Processor" +#define CPUINFO_PROC "model name"#endif Quoted 3 lines
Quoted 3 lines
tools/perf/perf-sys.h +0
-0#ifdef __aarch64__Signature · 1 line
1.8.4bash-4.2# perf record ls
...
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.001 MB perf.data (~36 samples) ] bash-4.2# perf report --stdio --header
Error:
The perf.data file has no samples!
# ========# captured on: Fri Sep 12 10:09:10 2014 # hostname : arma15el # os release : 3.17.0+ # perf version : 3.10.53 # arch : armv7l # nrcpus online : 4 # nrcpus avail : 1 # cpudesc : (null) # total memory : 0 kB # cmdline : # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0 # pmu mappings: not available # ======== #
Quoted 21 lines · Arnaldo Carvalho de Melo
Em Thu, Oct 16, 2014 at 11:21:13AM +0800, Wang Nan escreveu:
Quoted 20 lines · Arnaldo Carvalho de Melo
Quoted 18 lines
Em Wed, Oct 15, 2014 at 11:28:53AM +0800, Wang Nan escreveu:
Quoted 7 lines
Commit
fbe96f29(perf tools: Make perf.data more self-descriptive) read '/proc/cpuinfo' to form cpu descriptor. For ARM, it finds 'Processor' field. It is correct when the patch merged, but due to commitb4b8f770(ARM: kernel: update cpuinfo to print all online CPUs features), the corresponding information becomes 'model name' field.This patch simply corrects it.
It doesn't :-)
It makes it work with kernels >=
b4b8f770, and fail with older kernels.We need to somehow figure out where the right information is regardless of the kernel.
- Arnaldo
Quoted 13 lines
Quoted 2 lines
However it is a real problem. Look at output on arm platform at the bottom of this mail, especially "cpudesc", "total memory" and "cmdline" field.
Yeah, I haven't said it wasn't a problem, just that the proposed fix wasn't enough.
- Arnaldo
Quoted 5 lines
By further debugging I found that the real problem resides in return value checking when write header error. Please see my other patches:
https://lkml.org/lkml/2014/10/15/612
https://lkml.org/lkml/2014/10/15/611
So what's your opinion on these two patches?
Quoted 52 lines
Quoted 52 lines
I think at least one of them is required.
Thanks.
Quoted 17 lines
Quoted 17 lines
Signed-off-by Wang Nan <[email protected]>--- tools/perf/perf-sys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/perf-sys.h +1
-1@@ -113,7 +113,7 @@#define mb () ((void(*)(void))0xffff0fa0)()#define wmb () ((void(*)(void))0xffff0fa0)()#define rmb () ((void(*)(void))0xffff0fa0)() -#define CPUINFO_PROC "Processor" +#define CPUINFO_PROC "model name"#endif Quoted 3 lines
Quoted 3 lines
tools/perf/perf-sys.h +0
-0#ifdef __aarch64__Signature · 1 line
1.8.4bash-4.2# perf record ls
...
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.001 MB perf.data (~36 samples) ] bash-4.2# perf report --stdio --header
Error:
The perf.data file has no samples!
# ========# captured on: Fri Sep 12 10:09:10 2014 # hostname : arma15el # os release : 3.17.0+ # perf version : 3.10.53 # arch : armv7l # nrcpus online : 4 # nrcpus avail : 1 # cpudesc : (null) # total memory : 0 kB # cmdline : # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0 # pmu mappings: not available # ======== #