perf timechart: Fix the wakeup-arrows that point to non-visible processes
PATCH 1/2 perf timechart: Fix the wakeup-arrows that point to non-visible processes
Quoted 1 line
From
81e4574cf1e2091443dc254470a2160d7be0f940Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
Date: Tue, 20 Oct 2009 06:40:57 +0900
Subject: [PATCH 1/2] perf timechart: Fix the wakeup-arrows that point to non-visible processes
The timechart wakeup arrows currently show no process information when the waker/wakee are processes that are not actually chosen to be shown on the timechart.
This patch fixes this oversight, by looking through all processes (after giving preference to visible processes) as well as falling back to just showing the PID if no name for the process can be resolved.
--- tools/perf/builtin-timechart.c | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-)
tools/perf/builtin-timechart.c +26 -2
@@ -765,19 +765,40 @@ static void draw_wakeups(void)if (c->Y && c->start_time <= we->time && c->end_time >= we->time) {if (p->pid == we->waker) { from = c->Y; - task_from = c->comm; + task_from =strdup (c->comm); }if (p->pid == we->wakee) { to = c->Y; - task_to = c->comm; + task_to =strdup (c->comm); } } c = c->next; } + c = p->all; +while (c) { +if (p->pid == we->waker && !from) { + from = c->Y; + task_from =strdup (c->comm); + } +if (p->pid == we->wakee && !to) { + to = c->Y; + task_to =strdup (c->comm); + } + c = c->next; + } } p = p->next; } +if (!task_from) { + task_from =malloc (40 ); +sprintf (task_from,"[%i]" , we->waker); + } +if (!task_to) { + task_to =malloc (40 ); +sprintf (task_to,"[%i]" , we->wakee); + } +if (we->waker ==-1 )svg_interrupt (we->time, to);else if (from && to &&abs (from - to) ==1 )
@@ -785,6 +806,9 @@ static void draw_wakeups(void)else svg_partial_wakeline (we->time, from, task_from, to, task_to); we = we->next; + +free (task_from); +free (task_to); } }
Signature · 8 lines
1.6.2.5 -- Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org
Commit-ID: 3bc2a39c69d423d5d1f0b3ef77960b1464c976a0 Gitweb: http://git.kernel.org/tip/3bc2a39c69d423d5d1f0b3ef77960b1464c976a0 Author: Arjan van de Ven <[email protected]> AuthorDate: Tue, 20 Oct 2009 06:46:49 +0900 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 20 Oct 2009 03:39:16 +0200
perf timechart: Fix the wakeup-arrows that point to non-visible processes
The timechart wakeup arrows currently show no process information when the waker/wakee are processes that are not actually chosen to be shown on the timechart.
This patch fixes this oversight, by looking through all processes (after giving preference to visible processes) as well as falling back to just showing the PID if no name for the process can be resolved.
LKML-Reference: <[email protected]>
--- tools/perf/builtin-timechart.c | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-)
tools/perf/builtin-timechart.c +26 -2
@@ -765,19 +765,40 @@ static void draw_wakeups(void)if (c->Y && c->start_time <= we->time && c->end_time >= we->time) {if (p->pid == we->waker) { from = c->Y; - task_from = c->comm; + task_from =strdup (c->comm); }if (p->pid == we->wakee) { to = c->Y; - task_to = c->comm; + task_to =strdup (c->comm); } } c = c->next; } + c = p->all; +while (c) { +if (p->pid == we->waker && !from) { + from = c->Y; + task_from =strdup (c->comm); + } +if (p->pid == we->wakee && !to) { + to = c->Y; + task_to =strdup (c->comm); + } + c = c->next; + } } p = p->next; } +if (!task_from) { + task_from =malloc (40 ); +sprintf (task_from,"[%i]" , we->waker); + } +if (!task_to) { + task_to =malloc (40 ); +sprintf (task_to,"[%i]" , we->wakee); + } +if (we->waker ==-1 )svg_interrupt (we->time, to);else if (from && to &&abs (from - to) ==1 )
@@ -785,6 +806,9 @@ static void draw_wakeups(void)else svg_partial_wakeline (we->time, from, task_from, to, task_to); we = we->next; + +free (task_from); +free (task_to); } }