From: Stanislav Fomichev Date: Tue, 8 Jul 2014 16:03:42 +0000 (+0400) Subject: perf timechart: Conditionally update start_time on fork X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=962e310af5dff432745ae7494096ed54b752e63e;p=openwrt%2Fstaging%2Fblogic.git perf timechart: Conditionally update start_time on fork We don't need to overwrite current task start_time on fork, so update it only if it's zero. Signed-off-by: Stanislav Fomichev Acked-by: Namhyung Kim Link: http://lkml.kernel.org/n/1404835423-23098-4-git-send-email-stfomichev@yandex-team.ru Signed-off-by: Jiri Olsa --- diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 4079062d25b0..37bf1eb0755f 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c @@ -242,7 +242,7 @@ static void pid_fork(struct timechart *tchart, int pid, int ppid, u64 timestamp) pid_set_comm(tchart, pid, pp->current->comm); p->start_time = timestamp; - if (p->current) { + if (p->current && !p->current->start_time) { p->current->start_time = timestamp; p->current->state_since = timestamp; }