|
@@ -2514,6 +2514,7 @@ static int __add_probe_trace_events(struct perf_probe_event *pev,
|
|
|
{
|
|
|
int i, fd, ret;
|
|
|
struct probe_trace_event *tev = NULL;
|
|
|
+ struct probe_cache *cache = NULL;
|
|
|
struct strlist *namelist;
|
|
|
|
|
|
fd = probe_file__open(PF_FL_RW | (pev->uprobes ? PF_FL_UPROBE : 0));
|
|
@@ -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) < 0 ||
|
|
|
+ probe_cache__commit(cache) < 0)
|
|
|
+ pr_warning("Failed to add event to probe cache\n");
|
|
|
+ probe_cache__delete(cache);
|
|
|
+ }
|
|
|
|
|
|
strlist__delete(namelist);
|
|
|
close_out:
|