linux/tools/perf/util
Kan Liang 0c6b499495 perf top: Add option to set the number of thread for event synthesize
Using UINT_MAX to indicate the default thread#, which is the max number
of online CPU.

Committer testing:

  # perf trace --no-inherit -e clone -o /tmp/output perf top --num-thread-synthesize 9
  # cat /tmp/output
         ? (     ?   ):  ... [continued]: clone()) = 26651 (perf)
     0.059 ( 0.010 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bfac44f30, parent_tidptr: 0x7f5bfac459d0, child_tidptr: 0x7f5bfac459d0, tls: 0x7f5bfac45700) = 26652 (perf)
     0.116 ( 0.014 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bfa443f30, parent_tidptr: 0x7f5bfa4449d0, child_tidptr: 0x7f5bfa4449d0, tls: 0x7f5bfa444700) = 26653 (perf)
     0.141 ( 0.009 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bf9c42f30, parent_tidptr: 0x7f5bf9c439d0, child_tidptr: 0x7f5bf9c439d0, tls: 0x7f5bf9c43700) = 26654 (perf)
     0.160 ( 0.012 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bf9441f30, parent_tidptr: 0x7f5bf94429d0, child_tidptr: 0x7f5bf94429d0, tls: 0x7f5bf9442700) = 26655 (perf)
     0.232 ( 0.013 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5bf8c40f30, parent_tidptr: 0x7f5bf8c419d0, child_tidptr: 0x7f5bf8c419d0, tls: 0x7f5bf8c41700) = 26656 (perf)
     0.393 ( 0.011 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5be3ffef30, parent_tidptr: 0x7f5be3fff9d0, child_tidptr: 0x7f5be3fff9d0, tls: 0x7f5be3fff700) = 26657 (perf)
     0.802 ( 0.012 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5be37fdf30, parent_tidptr: 0x7f5be37fe9d0, child_tidptr: 0x7f5be37fe9d0, tls: 0x7f5be37fe700) = 26658 (perf)
     1.411 ( 0.022 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5be2ffcf30, parent_tidptr: 0x7f5be2ffd9d0, child_tidptr: 0x7f5be2ffd9d0, tls: 0x7f5be2ffd700) = 26659 (perf)
   246.422 ( 0.042 ms): clone(flags: VM|FS|FILES|SIGHAND|THREAD|SYSVSEM|SETTLS|PARENT_SETTID|CHILD_CLEARTID, child_stack: 0x7f5be2ffcf30, parent_tidptr: 0x7f5be2ffd9d0, child_tidptr: 0x7f5be2ffd9d0, tls: 0x7f5be2ffd700) = 26660 (perf)
  #

Signed-off-by: Kan Liang <kan.liang@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Lukasz Odzioba <lukasz.odzioba@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1506696477-146932-5-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-10-03 09:27:54 -03:00
..
c++ perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
include
intel-pt-decoder perf tools: Robustify detection of clang binary 2017-08-28 16:44:46 -03:00
libunwind
scripting-engines perf script python: Generate hooks with additional argument 2017-07-25 22:43:21 -03:00
annotate.c perf annotate stdio: Support --show-nr-samples option 2017-08-18 10:31:53 -03:00
annotate.h perf annotate: Store the sample period in each histogram bucket 2017-07-21 12:02:38 -03:00
auxtrace.c perf auxtrace: Add CPU filter support 2017-06-30 11:50:55 -03:00
auxtrace.h perf auxtrace: Add CPU filter support 2017-06-30 11:50:55 -03:00
block-range.c
block-range.h
bpf-loader.c tools include: Adopt strstarts() from the kernel 2017-07-20 15:46:10 -03:00
bpf-loader.h perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
bpf-prologue.c perf bpf: Fix endianness problem when loading parameters in prologue 2017-08-16 10:31:11 -03:00
bpf-prologue.h perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
branch.c perf util: Create branch.c/.h for common branch functions 2017-07-18 23:14:40 -03:00
branch.h perf report: Tag branch type/flag on "to" and tag cycles on "from" 2017-07-25 22:46:35 -03:00
Build perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
build-id.c perf header: Add struct feat_fd for write 2017-07-18 23:14:31 -03:00
build-id.h perf header: Add struct feat_fd for write 2017-07-18 23:14:31 -03:00
cache.h tools: Adopt __printf from kernel sources 2017-06-19 15:25:26 -03:00
call-path.c
call-path.h
callchain.c perf report: Fix debug messages with --call-graph option 2017-09-25 12:20:12 -03:00
callchain.h perf report: Calculate the average cycles of iterations 2017-08-30 10:03:27 -03:00
cgroup.c perf cgroup: Fix refcount usage 2017-07-25 11:23:50 -03:00
cgroup.h perf cgroup: Convert cgroup_sel.refcnt from atomic_t to refcount_t 2017-03-03 19:07:14 -03:00
cloexec.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
cloexec.h tools build: Add test for sched_getcpu() 2017-03-03 19:07:19 -03:00
color.c
color.h perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
comm.c perf tools: Lock to protect comm_str rb tree 2017-10-03 09:27:36 -03:00
comm.h
compress.h perf tools: Add compress.h for the *_decompress_to_file() headers 2017-04-24 12:33:33 -03:00
config.c perf config: Allow creating empty config set for config file autogeneration 2017-09-13 09:49:16 -03:00
config.h perf config: Do not die when parsing u64 or int config values 2017-06-27 11:44:58 -03:00
counts.c perf tools: Move path related functions to util/path.h 2017-04-19 13:01:53 -03:00
counts.h perf stat: Use group read for event groups 2017-07-26 14:25:44 -03:00
cpumap.c perf tools: Remove include dirent.h from util.h 2017-04-19 13:01:55 -03:00
cpumap.h perf cpumap: Introduce cpu_map__snprint_mask() 2017-03-03 19:07:17 -03:00
cs-etm.h
ctype.c perf tools: Move sane ctype stuff from util.h to sane_ctype.h 2017-04-19 13:01:48 -03:00
data-convert-bt.c perf data: Add mmap[2] events to CTF conversion 2017-07-28 16:26:06 -03:00
data-convert-bt.h
data-convert.h
data.c perf tools: Make copyfile_offset() static 2017-09-13 09:49:16 -03:00
data.h
db-export.c
db-export.h
debug.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
debug.h tools: Adopt __printf from kernel sources 2017-06-19 15:25:26 -03:00
demangle-java.c perf tools: Move sane ctype stuff from util.h to sane_ctype.h 2017-04-19 13:01:48 -03:00
demangle-java.h
demangle-rust.c
demangle-rust.h
drv_configs.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
drv_configs.h
dso.c perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
dso.h perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
dump-insn.c perf script: Add 'brstackinsn' for branch stacks 2017-03-16 09:24:35 -03:00
dump-insn.h perf script: Add 'brstackinsn' for branch stacks 2017-03-16 09:24:35 -03:00
dwarf-aux.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
dwarf-aux.h
dwarf-regs.c perf tools: Add include <linux/kernel.h> where ARRAY_SIZE() is used 2017-04-19 13:01:44 -03:00
env.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
env.h
event.c perf top: Add option to set the number of thread for event synthesize 2017-10-03 09:27:54 -03:00
event.h perf top: Implement multithreading for perf_event__synthesize_threads 2017-10-03 09:27:46 -03:00
evlist.c perf evsel: Fix buffer overflow while freeing events 2017-08-22 11:51:31 -03:00
evlist.h perf tools: Make copyfile_offset() static 2017-09-13 09:49:16 -03:00
evsel.c Merge remote-tracking branch 'tip/perf/urgent' into perf/core, to pick up fixes 2017-10-02 13:58:12 -03:00
evsel.h perf tools: Support weak groups in 'perf stat' 2017-09-13 09:49:12 -03:00
evsel_fprintf.c perf script: Add --inline option for debugging 2017-05-24 08:41:48 +02:00
expr.h perf tools: Increase maximum number of events in expressions 2017-08-22 12:19:05 -03:00
expr.y perf tools: Dedup events in expression parsing 2017-08-22 12:19:08 -03:00
find-vdso-map.c
genelf.c
genelf.h
genelf_debug.c tools: Adopt __packed from kernel sources 2017-06-19 15:27:07 -03:00
generate-cmdlist.sh
group.h
header.c perf tools: Use default CPUINFO_PROC where it fits 2017-08-17 16:58:21 -03:00
header.h perf tools: Add feature header record to pipe-mode 2017-07-18 23:14:36 -03:00
help-unknown-cmd.c perf config: Do not die when parsing u64 or int config values 2017-06-27 11:44:58 -03:00
help-unknown-cmd.h
hist.c perf sort: Add sort option for physical address 2017-09-01 14:46:11 -03:00
hist.h perf sort: Add sort option for physical address 2017-09-01 14:46:11 -03:00
intel-bts.c perf intel-pt/bts: Remove unused SAMPLE_SIZE defines and bts priv array 2017-06-19 15:27:09 -03:00
intel-bts.h
intel-pt.c perf intel-pt: Synthesize new power and "ptwrite" events 2017-06-30 11:48:28 -03:00
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c perf str{filter,list}: Disentangle headers 2017-04-19 13:01:52 -03:00
jitdump.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c tools include: Adopt strstarts() from the kernel 2017-07-20 15:46:10 -03:00
llvm-utils.h
lzma.c perf tools: Add compress.h for the *_decompress_to_file() headers 2017-04-24 12:33:33 -03:00
machine.c perf top: Implement multithreading for perf_event__synthesize_threads 2017-10-03 09:27:46 -03:00
machine.h perf top: Implement multithreading for perf_event__synthesize_threads 2017-10-03 09:27:46 -03:00
map.c perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
map.h perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
mem-events.c perf c2c: Fix remote HITM detection for Skylake 2017-08-28 11:05:10 -03:00
mem-events.h
memswap.c perf memswap: Split the byteswap memory range wrappers from util.[ch] 2017-04-25 15:45:35 -03:00
memswap.h perf memswap: Split the byteswap memory range wrappers from util.[ch] 2017-04-25 15:45:35 -03:00
metricgroup.c perf stat: Fix adding multiple event groups 2017-09-21 13:12:58 -03:00
metricgroup.h perf stat: Support JSON metrics in perf stat 2017-09-13 09:49:13 -03:00
namespaces.c perf tools: Make copyfile_offset() static 2017-09-13 09:49:16 -03:00
namespaces.h perf probe: Allow placing uprobes in alternate namespaces. 2017-07-18 23:14:10 -03:00
ordered-events.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
ordered-events.h
parse-branch-options.c perf record: Create a new option save_type in --branch-filter 2017-07-18 23:14:39 -03:00
parse-branch-options.h
parse-events.c perf pmu: Improve error messages for missing PMUs 2017-09-18 09:40:20 -03:00
parse-events.h perf pmu: Improve error messages for missing PMUs 2017-09-18 09:40:20 -03:00
parse-events.l perf stat: Support duration_time for metrics 2017-09-13 09:49:14 -03:00
parse-events.y perf events parse: Rename parse_events_parse arguments 2017-08-17 16:39:15 -03:00
parse-regs-options.c
parse-regs-options.h
path.c perf tools: Move path related functions to util/path.h 2017-04-19 13:01:53 -03:00
path.h perf tools: Move path related functions to util/path.h 2017-04-19 13:01:53 -03:00
perf-hooks-list.h
perf-hooks.c perf tools: Add include <linux/kernel.h> where ARRAY_SIZE() is used 2017-04-19 13:01:44 -03:00
perf-hooks.h
PERF-VERSION-GEN
perf_regs.c perf/sdt/x86: Move OP parser to tools/perf/arch/x86/ 2017-03-28 12:25:30 -03:00
perf_regs.h perf/sdt/x86: Move OP parser to tools/perf/arch/x86/ 2017-03-28 12:25:30 -03:00
pmu.c perf tools: Make copyfile_offset() static 2017-09-13 09:49:16 -03:00
pmu.h perf pmu: Extract function to get JSON alias map 2017-09-13 09:49:13 -03:00
pmu.l
pmu.y
print_binary.c perf tools: Move print_binary definitions to separate files 2017-04-19 13:01:50 -03:00
print_binary.h perf tools: Move print_binary definitions to separate files 2017-04-19 13:01:50 -03:00
probe-event.c perf probe: Fix kprobe blacklist checking condition 2017-08-29 11:14:12 -03:00
probe-event.h perf probe: Allow placing uprobes in alternate namespaces. 2017-07-18 23:14:10 -03:00
probe-file.c perf tools: Make copyfile_offset() static 2017-09-13 09:49:16 -03:00
probe-file.h perf buildid-cache: Support binary objects from other namespaces 2017-07-18 23:14:11 -03:00
probe-finder.c perf str{filter,list}: Disentangle headers 2017-04-19 13:01:52 -03:00
probe-finder.h perf tools: Move sane ctype stuff from util.h to sane_ctype.h 2017-04-19 13:01:48 -03:00
pstack.c
pstack.h
python-ext-sources perf buildid-cache: Support binary objects from other namespaces 2017-07-18 23:14:11 -03:00
python.c perf callchain: Move callchain specific routines from util.[ch] 2017-04-24 13:43:26 -03:00
quote.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
quote.h
rb_resort.h perf machine: Use hashtable for machine threads 2017-09-18 09:40:19 -03:00
rblist.c
rblist.h
record.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
rwsem.c perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
rwsem.h perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
sane_ctype.h perf tools: Move sane ctype stuff from util.h to sane_ctype.h 2017-04-19 13:01:48 -03:00
session.c perf ui progress: Add size info into progress bar 2017-09-13 09:49:15 -03:00
session.h perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
setns.c tools build: Add test for setns() 2017-07-18 23:14:08 -03:00
setup.py perf python: Filter out -specs=/a/b/c from the python binding cc options 2017-02-17 10:31:13 -03:00
smt.c perf tools: Add utility function to detect SMT status 2017-08-22 12:09:04 -03:00
smt.h perf tools: Add utility function to detect SMT status 2017-08-22 12:09:04 -03:00
sort.c perf sort: Add sort option for physical address 2017-09-01 14:46:11 -03:00
sort.h perf sort: Add sort option for physical address 2017-09-01 14:46:11 -03:00
srcline.c perf srcline: Do not consider empty files as valid srclines 2017-08-11 16:06:31 -03:00
srcline.h perf tools: Move srcline definitions to separate header 2017-04-19 13:01:50 -03:00
stat-shadow.c perf stat: Support duration_time for metrics 2017-09-13 09:49:14 -03:00
stat.c perf evsel: Add read_counter() 2017-07-26 14:21:59 -03:00
stat.h perf stat: Support JSON metrics in perf stat 2017-09-13 09:49:13 -03:00
strbuf.c tools lib string: Adopt prefixcmp() from perf and subcmd 2017-04-26 15:49:21 -03:00
strbuf.h tools: Adopt __printf from kernel sources 2017-06-19 15:25:26 -03:00
strfilter.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
strfilter.h
string.c perf tools: Move extra string util functions to util/string2.h 2017-04-19 13:01:51 -03:00
string2.h perf tools: Move extra string util functions to util/string2.h 2017-04-19 13:01:51 -03:00
strlist.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
strlist.h
svghelper.c
svghelper.h
symbol-elf.c perf test: Fix vmlinux failure on s390x 2017-09-28 13:01:42 -03:00
symbol-minimal.c perf util: Take elf_name as const string in dso__demangle_sym 2017-08-11 16:06:31 -03:00
symbol.c perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
symbol.h perf test: Fix vmlinux failure on s390x 2017-09-28 13:01:42 -03:00
symbol_fprintf.c perf symbols: No need to check if sym->name is NULL 2017-02-13 17:22:34 -03:00
syscalltbl.c perf tools: Fix syscalltbl build failure 2017-09-25 12:21:05 -03:00
syscalltbl.h perf syscalltbl: Support glob matching on syscall names 2017-09-01 14:45:48 -03:00
target.c
target.h
term.c perf tools: Don't include terminal handling headers in util.h 2017-04-19 13:01:53 -03:00
term.h
thread-stack.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
thread-stack.h
thread.c perf tools: Lock to protect namespaces and comm list 2017-10-03 09:27:27 -03:00
thread.h perf tools: Lock to protect namespaces and comm list 2017-10-03 09:27:27 -03:00
thread_map.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
thread_map.h perf thread_map: Convert thread_map.refcnt from atomic_t to refcount_t 2017-03-03 19:07:16 -03:00
time-utils.c perf tools: Move timestamp routines from util.h to time-utils.h 2017-04-20 13:22:44 -03:00
time-utils.h perf tools: Move timestamp routines from util.h to time-utils.h 2017-04-20 13:22:44 -03:00
tool.h perf tools: Add feature header record to pipe-mode 2017-07-18 23:14:36 -03:00
top.c
top.h perf top: Add option to set the number of thread for event synthesize 2017-10-03 09:27:54 -03:00
trace-event-info.c perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
trace-event-parse.c perf event-parse: Use pr_warning() 2017-06-27 11:08:14 -03:00
trace-event-read.c perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
trace-event-scripting.c
trace-event.c
trace-event.h perf util: Save pid-cmdline mapping into tracing header 2017-01-26 11:42:59 -03:00
trigger.h
tsc.c
tsc.h
units.c perf units: Move parse_tag_value() to units.[ch] 2017-04-26 15:40:31 -03:00
units.h perf units: Move parse_tag_value() to units.[ch] 2017-04-26 15:40:31 -03:00
unwind-libdw.c perf unwind: Report module before querying isactivation in dwfl unwind 2017-06-16 14:37:30 -03:00
unwind-libdw.h perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
unwind-libunwind-local.c perf report: Fix off-by-one for non-activation frames 2017-05-24 08:41:48 +02:00
unwind-libunwind.c perf unwind: Do not fail due to missing unwind support 2017-07-04 11:43:58 -03:00
unwind.h perf unwind: Provide only forward declarations for pointer types 2017-04-20 13:22:43 -03:00
usage.c perf tools: Kill die() 2017-06-27 11:49:13 -03:00
util-cxx.h
util.c perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
util.h perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
values.c perf report: Group stat values on global event id 2017-08-28 16:44:44 -03:00
values.h
vdso.c perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
vdso.h
xyarray.c perf xyarray: Save max_x, max_y 2017-08-22 11:51:28 -03:00
xyarray.h perf xyarray: Save max_x, max_y 2017-08-22 11:51:28 -03:00
zlib.c perf tools: Make copyfile_offset() static 2017-09-13 09:49:16 -03:00