1 % PT_BLK_ALLOC_DECODER(3)
4 ! Copyright (c) 2016-2018, Intel Corporation
6 ! Redistribution and use in source and binary forms, with or without
7 ! modification, are permitted provided that the following conditions are met:
9 ! * Redistributions of source code must retain the above copyright notice,
10 ! this list of conditions and the following disclaimer.
11 ! * Redistributions in binary form must reproduce the above copyright notice,
12 ! this list of conditions and the following disclaimer in the documentation
13 ! and/or other materials provided with the distribution.
14 ! * Neither the name of Intel Corporation nor the names of its contributors
15 ! may be used to endorse or promote products derived from this software
16 ! without specific prior written permission.
18 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 ! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 ! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 ! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 ! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 ! POSSIBILITY OF SUCH DAMAGE.
33 pt_blk_alloc_decoder, pt_blk_free_decoder - allocate/free an Intel(R) Processor
39 | **\#include `<intel-pt.h>`**
41 | **struct pt_block_decoder \***
42 | **pt_blk_alloc_decoder(const struct pt_config \**config*);**
44 | **void pt_blk_free_decoder(struct pt_block_decoder \**decoder*);**
51 A block decoder decodes raw Intel Processor Trace (Intel PT) into a sequence of
52 blocks of instructions described by the *pt_block* structure. See
55 **pt_blk_alloc_decoder**() allocates a new block decoder and returns a pointer
56 to it. The *config* argument points to a *pt_config* object. See
57 **pt_config**(3). The *config* argument will not be referenced by the returned
58 decoder but the trace buffer defined by the *config* argument's *begin* and
61 The returned block decoder needs to be synchronized onto the trace stream before
62 it can be used. To synchronize the decoder, use **pt_blk_sync_forward**(3),
63 **pt_blk_sync_backward**(3), or **pt_blk_sync_set**(3).
65 **pt_blk_free_decoder**() frees the Intel PT block decoder pointed to by
66 *decoder*. The *decoder* argument must be NULL or point to a decoder that has
67 been allocated by a call to **pt_blk_alloc_decoder**().
72 **pt_blk_alloc_decoder**() returns a pointer to a *pt_block_decoder* object on
73 success or NULL in case of an error.
79 struct pt_block_decoder *decoder;
82 decoder = pt_blk_alloc_decoder(config);
86 errcode = decode(decoder);
88 pt_blk_free_decoder(decoder);
95 **pt_config**(3), **pt_blk_sync_forward**(3), **pt_blk_sync_backward**(3),
96 **pt_blk_sync_set**(3), **pt_blk_get_offset**(3), **pt_blk_get_sync_offset**(3),
97 **pt_blk_get_image**(3), **pt_blk_set_image**(3), **pt_blk_get_config**(3),
98 **pt_blk_time**(3), **pt_blk_core_bus_ratio**(3), **pt_blk_next**(3)