perf_counter tools: Add and use isprint()

Introduce isprint() to print out raw event dumps to ASCII, etc.

(This is an extension to upstream Git's ctype.c.)

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
[ removed openssl.h inclusion from util.h - it leaked ctype.h ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Peter Zijlstra
2009-06-18 09:44:20 +02:00
committed by Ingo Molnar
parent 7522060c95
commit a73c7d84a1
3 changed files with 20 additions and 18 deletions

View File

@@ -1285,7 +1285,7 @@ static void trace_event(event_t *event)
for (j = 0; j < 15-(i & 15); j++)
cdprintf(" ");
for (j = 0; j < (i & 15); j++) {
if (issane(raw_event[i-15+j]))
if (isprint(raw_event[i-15+j]))
cdprintf("%c", raw_event[i-15+j]);
else
cdprintf(".");