perf tools: Refactor comm/tgid lookup
authorDavid Ahern <dsahern@gmail.com>
Mon, 30 Mar 2015 20:35:57 +0000 (14:35 -0600)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 31 Mar 2015 20:52:30 +0000 (17:52 -0300)
commit5aa0b030e8d29d6719c144818814b519cfcb105c
tree5558b3d391b99c78f2fe3003499815883a7536ba
parent73dbcd6537f0ef6bf98d84f8fd7f8ab9994c6cd8
perf tools: Refactor comm/tgid lookup

Rather than parsing /proc/pid/status file one line at a time, read it
into a buffer in one shot and search for all strings in one pass.

tgid conversion also simplified -- removing the isspace walk. As noted
by Arnaldo those are not needed for atoi == strtol calls.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Mario <jmario@redhat.com>
Link: http://lkml.kernel.org/r/1427747758-18510-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/event.c