1PT_BLK_ALLOC_DECODER(3)                                PT_BLK_ALLOC_DECODER(3)
2
3
4

NAME

6       pt_blk_alloc_decoder,  pt_blk_free_decoder  - allocate/free an Intel(R)
7       Processor Trace block decoder
8

SYNOPSIS

10       #include <intel-pt.h>
11       struct pt_block_decoder *
12       pt_blk_alloc_decoder(const struct pt_config *config);
13       void pt_blk_free_decoder(struct pt_block_decoder *decoder);
14
15       Link with -lipt.
16

DESCRIPTION

18       A block decoder decodes raw Intel Processor Trace (Intel PT) into a se‐
19       quence  of  blocks of instructions described by the pt_block structure.
20       See pt_blk_next(3).
21
22       pt_blk_alloc_decoder() allocates a new  block  decoder  and  returns  a
23       pointer  to it.  The config argument points to a pt_config object.  See
24       pt_config(3).  The config argument will not be referenced  by  the  re‐
25       turned  decoder  but  the trace buffer defined by the config argument's
26       begin and end fields will.
27
28       The returned block decoder needs to  be  synchronized  onto  the  trace
29       stream  before  it  can  be  used.   To  synchronize  the  decoder, use
30       pt_blk_sync_forward(3), pt_blk_sync_backward(3), or pt_blk_sync_set(3).
31
32       pt_blk_free_decoder() frees the Intel PT block decoder  pointed  to  by
33       decoder.   The decoder argument must be NULL or point to a decoder that
34       has been allocated by a call to pt_blk_alloc_decoder().
35

RETURN VALUE

37       pt_blk_alloc_decoder() returns a pointer to a  pt_block_decoder  object
38       on success or NULL in case of an error.
39

EXAMPLE

41                  struct pt_block_decoder *decoder;
42                  int errcode;
43
44                  decoder = pt_blk_alloc_decoder(config);
45                  if (!decoder)
46                      return pte_nomem;
47
48                  errcode = decode(decoder);
49
50                  pt_blk_free_decoder(decoder);
51                  return errcode;
52

SEE ALSO

54       pt_config(3),      pt_blk_sync_forward(3),     pt_blk_sync_backward(3),
55       pt_blk_sync_set(3),  pt_blk_get_offset(3),   pt_blk_get_sync_offset(3),
56       pt_blk_get_image(3),     pt_blk_set_image(3),     pt_blk_get_config(3),
57       pt_blk_time(3), pt_blk_core_bus_ratio(3), pt_blk_next(3)
58
59
60
61                                                       PT_BLK_ALLOC_DECODER(3)
Impressum