[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1310648130.2586.251.camel@twins>
Date: Thu, 14 Jul 2011 14:55:30 +0200
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Michael Neuling <mikey@...ling.org>,
Sonny Rao <sonnyrao@...omium.org>, acme@...hat.com,
anton@...ba.org, Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...e.hu>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [RFCv3] perf: robustify proc and debugfs file recording
On Thu, 2011-07-14 at 08:45 -0400, Steven Rostedt wrote:
> ---
> tools/perf/util/trace-event-info.c | 120 ++++++++------------------------=
> -----
> 1 file changed, 29 insertions(+), 91 deletions(-)
>
> Index: linux-ozlabs/tools/perf/util/trace-event-info.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- linux-ozlabs.orig/tools/perf/util/trace-event-info.c 2011-07-13 20:42:2=
> 4.442945973 +1000
> +++ linux-ozlabs/tools/perf/util/trace-event-info.c 2011-07-14 10:14:19.072=
> 946058 +1000
> @@ -183,106 +183,59 @@
> return *ptr =3D=3D 0x01020304;
> }
> =20
> -static unsigned long long copy_file_fd(int fd)
> +/* unfortunately, you can not stat debugfs or proc files for size */
> +static void record_file(const char *file, size_t hdr_sz)
> {
> unsigned long long size =3D 0;
Yeah, its all the rage, we're supposed to write full RFC compliant email
parsers these days :(
/Content-Transfer-Encoding:.*quoted-printable.*/ {
decode = 1;
}
// {
tmp = $0
if (!decode) {
print tmp
next
}
if (concat) {
tmp = last tmp
concat = 0;
}
if (tmp ~ /=$/) {
concat = 1;
gsub("=$", "", tmp);
}
offset = 0;
while (match(tmp, /=[[:xdigit:]][[:xdigit:]]/, a)) {
if (a[0] < offset)
break;
hex = substr(a[0], 2)
char = sprintf("%c", strtonum("0x"hex))
gsub(a[0], char, tmp)
offset = a[0];
}
if (concat) {
last = tmp
next
}
print tmp
}
Should decode that crap I think..
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists