mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-capture: Add SysprofCaptureJitmapIter to replace GHashTable
Change `sysprof_capture_reader_read_jitmap()` to return a `const SysprofCaptureJitmap *` (like the other `read` functions), and add a new `SysprofCaptureJitmapIter` type to allow easy iteration over the jitmap. This allows a use of `GHashTable` to be removed from the API. It breaks the libsysprof-capture API and ABI. All the callers iterate over the jitmap rather than looking up elements by key. If that functionality is needed in future, additional API can be added to allow it on `SysprofCaptureJitmap`. Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #40
This commit is contained in:
@ -115,7 +115,7 @@ const SysprofCaptureProcess *sysprof_capture_reader_read_process (
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
const SysprofCaptureSample *sysprof_capture_reader_read_sample (SysprofCaptureReader *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
GHashTable *sysprof_capture_reader_read_jitmap (SysprofCaptureReader *self);
|
||||
const SysprofCaptureJitmap *sysprof_capture_reader_read_jitmap (SysprofCaptureReader *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
const SysprofCaptureCounterDefine *sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
@ -150,5 +150,21 @@ bool sysprof_capture_reader_read_file_fd (
|
||||
const char *path,
|
||||
int fd);
|
||||
|
||||
typedef struct {
|
||||
/*< private >*/
|
||||
void *p1;
|
||||
void *p2;
|
||||
unsigned int u1;
|
||||
void *p3;
|
||||
void *p4;
|
||||
} SysprofCaptureJitmapIter;
|
||||
|
||||
SYSPROF_AVAILABLE_IN_3_38
|
||||
void sysprof_capture_jitmap_iter_init (SysprofCaptureJitmapIter *iter,
|
||||
const SysprofCaptureJitmap *jitmap);
|
||||
SYSPROF_AVAILABLE_IN_3_38
|
||||
bool sysprof_capture_jitmap_iter_next (SysprofCaptureJitmapIter *iter,
|
||||
SysprofCaptureAddress *addr,
|
||||
const char **path);
|
||||
|
||||
SYSPROF_END_DECLS
|
||||
|
||||
Reference in New Issue
Block a user