perf callchain: Per-event type selection support
This patchkit adds the ability to set callgraph mode (fp, dwarf, lbr) per event. This in term can reduce sampling overhead and the size of the perf.data. Here is an example. perf record -e 'cpu/cpu-cycles,period=1000,call-graph=fp,time=1/,cpu/instructions,call-graph=lbr/' sleep 1 perf evlist -v cpu/cpu-cycles,period=1000,call-graph=fp,time=1/: type: 4, size: 112, config: 0x3c, { sample_period, sample_freq }: 1000, sample_type: IP|TID|TIME|CALLCHAIN|PERIOD|IDENTIFIER, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1 cpu/instructions,call-graph=lbr/: type: 4, size: 112, config: 0xc0, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CALLCHAIN|PERIOD|BRANCH_STACK|IDENTIFIER, read_format: ID, disabled: 1, inherit: 1, freq: 1, enable_on_exec: 1, sample_id_all: 1, exclude_guest: 1 Signed-off-by: Kan Liang <kan.liang@intel.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1439289050-40510-1-git-send-email-kan.liang@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
75186a9b09
commit
d457c96392
@@ -614,6 +614,12 @@ do { \
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
case PARSE_EVENTS__TERM_TYPE_CALLGRAPH:
|
||||
CHECK_TYPE_VAL(STR);
|
||||
break;
|
||||
case PARSE_EVENTS__TERM_TYPE_STACKSIZE:
|
||||
CHECK_TYPE_VAL(NUM);
|
||||
break;
|
||||
case PARSE_EVENTS__TERM_TYPE_NAME:
|
||||
CHECK_TYPE_VAL(STR);
|
||||
break;
|
||||
@@ -668,6 +674,12 @@ do { \
|
||||
case PARSE_EVENTS__TERM_TYPE_TIME:
|
||||
ADD_CONFIG_TERM(TIME, time, term->val.num);
|
||||
break;
|
||||
case PARSE_EVENTS__TERM_TYPE_CALLGRAPH:
|
||||
ADD_CONFIG_TERM(CALLGRAPH, callgraph, term->val.str);
|
||||
break;
|
||||
case PARSE_EVENTS__TERM_TYPE_STACKSIZE:
|
||||
ADD_CONFIG_TERM(STACK_USER, stack_user, term->val.num);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user