diff options
Diffstat (limited to 'tools/perf/util/clockid.c')
-rw-r--r-- | tools/perf/util/clockid.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/clockid.c b/tools/perf/util/clockid.c index b7a08606dc3e..74365a5d99c1 100644 --- a/tools/perf/util/clockid.c +++ b/tools/perf/util/clockid.c @@ -106,3 +106,14 @@ int parse_clockid(const struct option *opt, const char *str, int unset) ui__warning("unknown clockid %s, check man page\n", ostr); return -1; } + +const char *clockid_name(clockid_t clk_id) +{ + const struct clockid_map *cm; + + for (cm = clockids; cm->name; cm++) { + if (cm->clockid == clk_id) + return cm->name; + } + return "(not found)"; +} |