OSDN Git Service

simpleperf: avoid selinux denials.
authorYabin Cui <yabinc@google.com>
Mon, 22 Aug 2016 20:39:19 +0000 (13:39 -0700)
committerYabin Cui <yabinc@google.com>
Mon, 22 Aug 2016 20:40:30 +0000 (13:40 -0700)
commit078658638c01c035ebcb98a557628101566a1d57
treec60df085398b1d775db1e6f614be0b6d68ee2907
parentcb0112fe640d7b8a9668f91d2cad7234bd63f880
simpleperf: avoid selinux denials.

1. Don't stat() entries in /proc directory if not necessary.
2. Don't read tracing events in debugfs if not root.

Bug: http://b/30981595
Change-Id: Ic695671357dad936d60f4e6d573ce4452dec217c
Test: run `simpleperf list` and check kmsg.
simpleperf/dso.cpp
simpleperf/environment.cpp
simpleperf/event_type.cpp
simpleperf/utils.cpp
simpleperf/utils.h