Re: [PATCH perf/core v10 07/23] perf probe: Add --cache option to cache the probe definitions

From: Arnaldo Carvalho de Melo
Date: Thu Jun 09 2016 - 10:18:58 EST


Em Wed, Jun 08, 2016 at 06:30:10PM +0900, Masami Hiramatsu escreveu:
> @@ -2555,6 +2556,14 @@ static int __add_probe_trace_events(struct perf_probe_event *pev,
> }
> if (ret == -EINVAL && pev->uprobes)
> warn_uprobe_event_compat(tev);
> + if (ret == 0 && probe_conf.cache) {
> + cache = probe_cache__new(pev->target);
> + if (cache) {
> + probe_cache__add_entry(cache, pev, tevs, ntevs);
> + probe_cache__commit(cache);

These two functions may fail, please check its return and forward errors
appropriately.

> + probe_cache__delete(cache);