~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h

Version: ~ [ linux-5.2-rc4 ] ~ [ linux-5.1.9 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.50 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.125 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.181 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.181 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.68 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * intel_pt_decoder.h: Intel Processor Trace support
  3  * Copyright (c) 2013-2014, Intel Corporation.
  4  *
  5  * This program is free software; you can redistribute it and/or modify it
  6  * under the terms and conditions of the GNU General Public License,
  7  * version 2, as published by the Free Software Foundation.
  8  *
  9  * This program is distributed in the hope it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 12  * more details.
 13  *
 14  */
 15 
 16 #ifndef INCLUDE__INTEL_PT_DECODER_H__
 17 #define INCLUDE__INTEL_PT_DECODER_H__
 18 
 19 #include <stdint.h>
 20 #include <stddef.h>
 21 #include <stdbool.h>
 22 
 23 #include "intel-pt-insn-decoder.h"
 24 
 25 #define INTEL_PT_IN_TX          (1 << 0)
 26 #define INTEL_PT_ABORT_TX       (1 << 1)
 27 #define INTEL_PT_ASYNC          (1 << 2)
 28 
 29 enum intel_pt_sample_type {
 30         INTEL_PT_BRANCH         = 1 << 0,
 31         INTEL_PT_INSTRUCTION    = 1 << 1,
 32         INTEL_PT_TRANSACTION    = 1 << 2,
 33 };
 34 
 35 enum intel_pt_period_type {
 36         INTEL_PT_PERIOD_NONE,
 37         INTEL_PT_PERIOD_INSTRUCTIONS,
 38         INTEL_PT_PERIOD_TICKS,
 39         INTEL_PT_PERIOD_MTC,
 40 };
 41 
 42 enum {
 43         INTEL_PT_ERR_NOMEM = 1,
 44         INTEL_PT_ERR_INTERN,
 45         INTEL_PT_ERR_BADPKT,
 46         INTEL_PT_ERR_NODATA,
 47         INTEL_PT_ERR_NOINSN,
 48         INTEL_PT_ERR_MISMAT,
 49         INTEL_PT_ERR_OVR,
 50         INTEL_PT_ERR_LOST,
 51         INTEL_PT_ERR_UNK,
 52         INTEL_PT_ERR_NELOOP,
 53         INTEL_PT_ERR_MAX,
 54 };
 55 
 56 struct intel_pt_state {
 57         enum intel_pt_sample_type type;
 58         int err;
 59         uint64_t from_ip;
 60         uint64_t to_ip;
 61         uint64_t cr3;
 62         uint64_t tot_insn_cnt;
 63         uint64_t timestamp;
 64         uint64_t est_timestamp;
 65         uint64_t trace_nr;
 66         uint32_t flags;
 67         enum intel_pt_insn_op insn_op;
 68         int insn_len;
 69         char insn[INTEL_PT_INSN_BUF_SZ];
 70 };
 71 
 72 struct intel_pt_insn;
 73 
 74 struct intel_pt_buffer {
 75         const unsigned char *buf;
 76         size_t len;
 77         bool consecutive;
 78         uint64_t ref_timestamp;
 79         uint64_t trace_nr;
 80 };
 81 
 82 struct intel_pt_params {
 83         int (*get_trace)(struct intel_pt_buffer *buffer, void *data);
 84         int (*walk_insn)(struct intel_pt_insn *intel_pt_insn,
 85                          uint64_t *insn_cnt_ptr, uint64_t *ip, uint64_t to_ip,
 86                          uint64_t max_insn_cnt, void *data);
 87         bool (*pgd_ip)(uint64_t ip, void *data);
 88         void *data;
 89         bool return_compression;
 90         uint64_t period;
 91         enum intel_pt_period_type period_type;
 92         unsigned max_non_turbo_ratio;
 93         unsigned int mtc_period;
 94         uint32_t tsc_ctc_ratio_n;
 95         uint32_t tsc_ctc_ratio_d;
 96 };
 97 
 98 struct intel_pt_decoder;
 99 
100 struct intel_pt_decoder *intel_pt_decoder_new(struct intel_pt_params *params);
101 void intel_pt_decoder_free(struct intel_pt_decoder *decoder);
102 
103 const struct intel_pt_state *intel_pt_decode(struct intel_pt_decoder *decoder);
104 
105 unsigned char *intel_pt_find_overlap(unsigned char *buf_a, size_t len_a,
106                                      unsigned char *buf_b, size_t len_b,
107                                      bool have_tsc);
108 
109 int intel_pt__strerror(int code, char *buf, size_t buflen);
110 
111 #endif
112 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp