1PT_ISCACHE_READ(3)                                          PT_ISCACHE_READ(3)
2
3
4

NAME

6       pt_iscache_read - read memory from a cached file section
7

SYNOPSIS

9       #include <intel-pt.h>
10       int pt_iscache_read(struct pt_image_section_cache *iscache,
11                           uint8_t *buffer, uint64_t size, int isid,
12                           uint64_t vaddr);
13
14       Link with -lipt.
15

DESCRIPTION

17       pt_iscache_read()  reads  memory  from a cached file section.  The file
18       section must have previously been added by a call to pt_iscache_add(3).
19       The  iscache  argument points to the pt_image_section_cache object.  It
20       must be the same that was used in the  corresponding  pt_iscache_add(3)
21       call.   The  buffer  argument must point to a memory buffer of at least
22       size bytes.  The isid argument identifies the file section  from  which
23       memory  is read.  It must be the same identifier that was returned from
24       the corresponding pt_iscache_add(3) call that added the file section to
25       the  cache.   The  vaddr  argument gives the virtual address from which
26       size bytes of memory shall be read.
27
28       On success, pt_iscache_read() copies at most size bytes of memory  from
29       the  cached file section identified by isid in iscache starting at vir‐
30       tual address vaddr into buffer and returns the  number  of  bytes  that
31       were copied.
32
33       Multiple  calls to pt_iscache_read() may be necessary if size is bigger
34       than 4Kbyte or if the read crosses a section boundary.
35

RETURN VALUE

37       pt_iscache_read() returns the number of bytes that were read on success
38       or a negative pt_error_code enumeration constant in case of an error.
39

ERRORS

41       pte_invalid
42              The  iscache  or buffer argument is NULL or the size argument is
43              zero.
44
45       pte_bad_image
46              The iscache does not contain a section identified by isid.
47
48       pte_nomap
49              The vaddr argument lies outside of the virtual address range  of
50              the cached section.
51

SEE ALSO

53       pt_iscache_alloc(3), pt_iscache_free(3), pt_iscache_add(3)
54
55
56
57                                                            PT_ISCACHE_READ(3)
Impressum