From ee0e2a0231b88d873bf1447f5663684e620cb694 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Sun, 22 Jun 2014 18:34:04 +0100 Subject: Allow idlestat to parse older versions of trace output Re-work TRACE_FORMAT to allow idlestat to parse older kernels trace output. This has been tested successfully on Debian 7.5 with a 3.2.x kernel and also on 3.15 kernel. And example of the the newer format is: -0 [002] .N.. 1420.031852: cpu_idle: state=4294967295 cpu_id=2 where as the older format is: -0 [000] 91.365043: cpu_idle: state=1 cpu_id=0 The modified TRACE_FORMAT will handle both inputs by consuming characters upto the floating point time field. Signed-off-by: Colin Ian King Signed-off-by: Amit Kucheria --- idlestat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idlestat.c b/idlestat.c index 9407576..139d410 100644 --- a/idlestat.c +++ b/idlestat.c @@ -715,7 +715,7 @@ static int store_irq(int cpu, int irqid, char *irqname, #define TRACE_IPIIRQ_FORMAT "%*[^[][%d] %*[^=]=%d%*[^=]=%16s" #define TRACE_CMD_FORMAT "%*[^]]] %lf:%*[^=]=%u%*[^=]=%d" -#define TRACE_FORMAT "%*[^]]] %*s %lf:%*[^=]=%u%*[^=]=%u" +#define TRACE_FORMAT "%*[^]]]%*[^0-9] %lf:%*[^=]=%u%*[^=]=%u" static int get_wakeup_irq(struct cpuidle_datas *datas, char *buffer, int count) { -- cgit v1.2.3