Messages in this thread | | | Date | Mon, 11 May 2020 13:01:27 +0200 | From | Jiri Olsa <> | Subject | Re: [PATCH RFC v3 02/12] perf jevents: Add support for system events tables |
| |
On Thu, May 07, 2020 at 07:57:41PM +0800, John Garry wrote:
SNIP
> > +static bool is_sys_dir(char *fname) > +{ > + char *pos; > + > + while (true) { > + pos = strchr(fname, '/');
would strrchr be faster? also I thought there's something like basename function that could be usable in here?
jirka
> + > + if (!pos) { > + if (!strcmp(fname, "sys")) > + return true; > + return false; > + } > + > + fname = pos + 1; > + } > + > + return false; > +}
| |