1PT_ISCACHE_ALLOC(3)                                        PT_ISCACHE_ALLOC(3)
2
3
4

NAME

6       pt_iscache_alloc,  pt_iscache_free,  pt_iscache_name  - allocate/free a
7       traced memory image section cache
8

SYNOPSIS

10       #include <intel-pt.h>
11       struct pt_image_section_cache *pt_iscache_alloc(const char *name);
12       const char *pt_iscache_name(const  struct  pt_image_section_cache  *is‐
13       cache);
14       void pt_iscache_free(struct pt_image_section_cache *iscache);
15
16       Link with -lipt.
17

DESCRIPTION

19       pt_iscache_alloc() allocates a new pt_image_section_cache and returns a
20       pointer to it.  A pt_image_section_cache object contains  a  collection
21       of file sections and the virtual addresses at which those sections were
22       loaded.
23
24       The image sections can be added to one or more pt_image  objects.   The
25       underlying  file sections will be mapped once and their content will be
26       shared across images.
27
28       The name argument points to an optional  zero-terminated  name  string.
29       If  the  name  argument  is  NULL,  it will be ignored and the returned
30       pt_image_section_cache object will not have a name.  Otherwise, the re‐
31       turned  pt_image_section_object  object  will have a copy of the string
32       pointed to by the name argument as name.
33
34       pt_iscache_name() returns the name of the pt_image_section_cache object
35       the iscache argument points to.
36
37       pt_iscache_free() frees the pt_image_section_cache object pointed to by
38       iscache.  The iscache argument must be NULL or point to an  image  sec‐
39       tion cache that has been allocated by a call to pt_iscache_alloc().
40

RETURN VALUE

42       pt_iscache_alloc() returns a pointer to a pt_image_section_cache object
43       on success or NULL in case of an error.
44
45       pt_iscache_name() returns a pointer to a zero-terminated string of NULL
46       if the image section cache does not have a name.
47

EXAMPLE

49              int foo(const char *name) {
50                  struct pt_image_section_cache *iscache;
51                  errcode;
52
53                  image = pt_iscache_alloc(name);
54                  if (!iscache)
55                      return pte_nomem;
56
57                  errcode = bar(iscache);
58
59                  pt_iscache_free(iscache);
60                  return errcode;
61              }
62

SEE ALSO

64       pt_iscache_add_file(3), pt_image_add_cached(3)
65
66
67
68                                                           PT_ISCACHE_ALLOC(3)
Impressum