aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2014-08-08 14:39:37 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2014-08-08 16:15:10 +0200
commit1eb45bb2226dddafe713e4a375034f7069034924 (patch)
tree27a4a429261f19d613e681da39d8631167fce9fd
parentf7a16bcd8f6edbd1c8a1ef2ecb51096a3d0be04c (diff)
Fix IPI trace format to parse traces
The trace format changed a bit. Fix the parsing format to show the IPI wakes up. Also fix the IPI number by showing '---' as it does not make sense to display the IPI number and we have the IPI name associated with this IPI number. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Amit Kucheria <amit.kucheria@linaro.or>
-rw-r--r--idlestat.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/idlestat.c b/idlestat.c
index 9e5be03..bba8951 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -50,11 +50,6 @@
#define IDLESTAT_VERSION "0.4-rc1"
#define USEC_PER_SEC 1000000
-static char irq_type_name[][8] = {
- "irq",
- "ipi",
- };
-
static char buffer[BUFSIZE];
static inline int error(const char *str)
@@ -261,10 +256,14 @@ static int display_wakeup(void *arg, char *cpu)
printf("\n");
}
- printf("| %-6s | %-3d | %15.15s | %7d |\n",
- (irqinfo->irq_type < IRQ_TYPE_MAX) ?
- irq_type_name[irqinfo->irq_type] : "???",
- irqinfo->id, irqinfo->name, irqinfo->count);
+ if (irqinfo->irq_type == HARD_IRQ)
+ printf("| %-6s | %-3d | %15.15s | %7d |\n",
+ "irq", irqinfo->id, irqinfo->name,
+ irqinfo->count);
+
+ if (irqinfo->irq_type == IPI_IRQ)
+ printf("| %-6s | --- | %15.15s | %7d |\n",
+ "ipi", irqinfo->name, irqinfo->count);
}
return 0;
@@ -854,8 +853,7 @@ static int store_irq(int cpu, int irqid, char *irqname,
}
#define TRACE_IRQ_FORMAT "%*[^[][%d] %*[^=]=%d%*[^=]=%16s"
-#define TRACE_IPIIRQ_FORMAT "%*[^[][%d] %*[^=]=%d%*[^=]=%16s"
-
+#define TRACE_IPIIRQ_FORMAT "%*[^[][%d] %*[^(](%32s"
#define TRACECMD_REPORT_FORMAT "%*[^]]] %lf:%*[^=]=%u%*[^=]=%d"
#define TRACE_FORMAT "%*[^]]] %*s %lf:%*[^=]=%u%*[^=]=%d"
@@ -872,11 +870,10 @@ static int get_wakeup_irq(struct cpuidle_datas *datas, char *buffer, int count)
return 0;
}
- if (strstr(buffer, "ipi_handler_entry")) {
- assert(sscanf(buffer, TRACE_IPIIRQ_FORMAT, &cpu, &irqid,
- irqname) == 3);
-
- store_irq(cpu, irqid, irqname, datas, count, IPI_IRQ);
+ if (strstr(buffer, "ipi_entry")) {
+ assert(sscanf(buffer, TRACE_IPIIRQ_FORMAT, &cpu, irqname) == 2);
+ irqname[strlen(irqname) - 1] = '\0';
+ store_irq(cpu, -1, irqname, datas, count, IPI_IRQ);
return 0;
}