Commit 2ff8e576 authored by Vicent Marti's avatar Vicent Marti

cc: Allow callback cancellation on bcc_procutils

parent e725a3a5
...@@ -100,8 +100,10 @@ int bcc_procutils_each_module(int pid, bcc_procutils_modulecb callback, ...@@ -100,8 +100,10 @@ int bcc_procutils_each_module(int pid, bcc_procutils_modulecb callback,
while (isspace(mapname[0])) mapname++; while (isspace(mapname[0])) mapname++;
if (strchr(perm, 'x') && mapname[0] && mapname[0] != '[') if (strchr(perm, 'x') && mapname[0] && mapname[0] != '[') {
callback(mapname, (uint64_t)begin, (uint64_t)end, payload); if (callback(mapname, (uint64_t)begin, (uint64_t)end, payload) < 0)
break;
}
} }
} while (ret && ret != EOF); } while (ret && ret != EOF);
......
...@@ -22,8 +22,9 @@ ...@@ -22,8 +22,9 @@
extern "C" { extern "C" {
#endif #endif
typedef void (*bcc_procutils_modulecb)(const char *, uint64_t, uint64_t, #include <stdint.h>
void *);
typedef int (*bcc_procutils_modulecb)(const char *, uint64_t, uint64_t, void *);
typedef void (*bcc_procutils_ksymcb)(const char *, uint64_t, void *); typedef void (*bcc_procutils_ksymcb)(const char *, uint64_t, void *);
const char *bcc_procutils_which_so(const char *libname); const char *bcc_procutils_which_so(const char *libname);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment