diff options
Diffstat (limited to 'parse-events.c')
-rw-r--r-- | parse-events.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/parse-events.c b/parse-events.c index d2d7e0a..406b28f 100644 --- a/parse-events.c +++ b/parse-events.c | |||
@@ -348,6 +348,27 @@ const char *pevent_find_function(struct pevent *pevent, unsigned long long addr) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | /** | 350 | /** |
351 | * pevent_find_function_address - find a function address by a given address | ||
352 | * @pevent: handle for the pevent | ||
353 | * @addr: the address to find the function with | ||
354 | * | ||
355 | * Returns the address the function starts at. This can be used in | ||
356 | * conjunction with pevent_find_function to print both the function | ||
357 | * name and the function offset. | ||
358 | */ | ||
359 | unsigned long long | ||
360 | pevent_find_function_address(struct pevent *pevent, unsigned long long addr) | ||
361 | { | ||
362 | struct func_map *map; | ||
363 | |||
364 | map = find_func(pevent, addr); | ||
365 | if (!map) | ||
366 | return 0; | ||
367 | |||
368 | return map->addr; | ||
369 | } | ||
370 | |||
371 | /** | ||
351 | * pevent_register_function - register a function with a given address | 372 | * pevent_register_function - register a function with a given address |
352 | * @pevent: handle for the pevent | 373 | * @pevent: handle for the pevent |
353 | * @function: the function name to register | 374 | * @function: the function name to register |