Prev: [PATCH 2/3] perf: Remove dead code in buildin-record.c
Next: linux-next: build warning after merge of the drivers-x86 tree
From: Gui Jianfeng on 24 Jun 2010 22:30 If we execute perf record without -t or -p option, it fails to load process memory map to record file. Here fix it. Signed-off-by: Gui Jianfeng <guijianfeng(a)cn.fujitsu.com> --- tools/perf/builtin-record.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 84d58b7..f834d21 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -685,9 +685,19 @@ static int __cmd_record(int argc, const char **argv) if (perf_guest) perf_session__process_machines(session, event__synthesize_guest_os); - if (!system_wide && profile_cpu == -1) - event__synthesize_thread(target_tid, process_synthesized_event, - session); + if (!system_wide && profile_cpu == -1) { + int ret; + + if (target_tid != -1) { + ret = event__synthesize_thread(target_tid, + process_synthesized_event, + session); + } else { + ret = event__synthesize_thread(all_tids[0], + process_synthesized_event, + session); + } + } else event__synthesize_threads(process_synthesized_event, session); -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |