Skip to contentSkip to conversation

record failure with 3.14-rc4

perf tool Will Deacon 2 participants 2 messages Feb 24, 2014

lore
Share & tools
lore
#0 lore raw

Hi guys,

If I try to run perf record as a non-root user, I end up with the following (unhelpful) error:

  $ perf record -e cycles ls
  [...]
  Not enough memory for reading perf file header

This is because the addresses in /proc/kallsyms always read as 0x0 when viewed by a non-privileged user, causing kallsyms__get_function_start to return 0x0 in args.start. machine__create_kernel_maps then treats this as an error an returns -1 to perf_session__create_kernel_maps, causing perf_session__new to fail and perf to exit.

The perf tool code in 3.13 is perfectly happy creating maps at 0x0, but I can see this has changed quite substantially in the recent merge window.

Any ideas? We could fix kallsyms__get_function_start to return < 0 on failure then fix the checks in the callers. Adrian?

Will

#1 lore raw
Quoted 15 lines · Will Deacon

Hi guys,

If I try to run perf record as a non-root user, I end up with the following (unhelpful) error:

  $ perf record -e cycles ls
  [...]
  Not enough memory for reading perf file header

This is because the addresses in /proc/kallsyms always read as 0x0 when viewed by a non-privileged user, causing kallsyms__get_function_start to return 0x0 in args.start. machine__create_kernel_maps then treats this as an error an returns -1 to perf_session__create_kernel_maps, causing perf_session__new to fail and perf to exit.

Quoted 5 lines

The perf tool code in 3.13 is perfectly happy creating maps at 0x0, but I can see this has changed quite substantially in the recent merge window.

Any ideas? We could fix kallsyms__get_function_start to return < 0 on failure then fix the checks in the callers. Adrian?

hi,
not sure it's related, but i sent out rfc some time ago for similar bad error messages:
http://marc.info/?l=linux-kernel&m=138572558210216&w=2

maybe it could be updated for your case as well,
I'll try to check deeply later

jirka