mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
2025cf9e19
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 263 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
71 lines
1.7 KiB
C
71 lines
1.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* intel_pt_log.h: Intel Processor Trace support
|
|
* Copyright (c) 2013-2014, Intel Corporation.
|
|
*/
|
|
|
|
#ifndef INCLUDE__INTEL_PT_LOG_H__
|
|
#define INCLUDE__INTEL_PT_LOG_H__
|
|
|
|
#include <linux/compiler.h>
|
|
#include <stdint.h>
|
|
#include <inttypes.h>
|
|
|
|
struct intel_pt_pkt;
|
|
|
|
void *intel_pt_log_fp(void);
|
|
void intel_pt_log_enable(void);
|
|
void intel_pt_log_disable(void);
|
|
void intel_pt_log_set_name(const char *name);
|
|
|
|
void __intel_pt_log_packet(const struct intel_pt_pkt *packet, int pkt_len,
|
|
uint64_t pos, const unsigned char *buf);
|
|
|
|
struct intel_pt_insn;
|
|
|
|
void __intel_pt_log_insn(struct intel_pt_insn *intel_pt_insn, uint64_t ip);
|
|
void __intel_pt_log_insn_no_data(struct intel_pt_insn *intel_pt_insn,
|
|
uint64_t ip);
|
|
|
|
void __intel_pt_log(const char *fmt, ...) __printf(1, 2);
|
|
|
|
#define intel_pt_log(fmt, ...) \
|
|
do { \
|
|
if (intel_pt_enable_logging) \
|
|
__intel_pt_log(fmt, ##__VA_ARGS__); \
|
|
} while (0)
|
|
|
|
#define intel_pt_log_packet(arg, ...) \
|
|
do { \
|
|
if (intel_pt_enable_logging) \
|
|
__intel_pt_log_packet(arg, ##__VA_ARGS__); \
|
|
} while (0)
|
|
|
|
#define intel_pt_log_insn(arg, ...) \
|
|
do { \
|
|
if (intel_pt_enable_logging) \
|
|
__intel_pt_log_insn(arg, ##__VA_ARGS__); \
|
|
} while (0)
|
|
|
|
#define intel_pt_log_insn_no_data(arg, ...) \
|
|
do { \
|
|
if (intel_pt_enable_logging) \
|
|
__intel_pt_log_insn_no_data(arg, ##__VA_ARGS__); \
|
|
} while (0)
|
|
|
|
#define x64_fmt "0x%" PRIx64
|
|
|
|
extern bool intel_pt_enable_logging;
|
|
|
|
static inline void intel_pt_log_at(const char *msg, uint64_t u)
|
|
{
|
|
intel_pt_log("%s at " x64_fmt "\n", msg, u);
|
|
}
|
|
|
|
static inline void intel_pt_log_to(const char *msg, uint64_t u)
|
|
{
|
|
intel_pt_log("%s to " x64_fmt "\n", msg, u);
|
|
}
|
|
|
|
#endif
|