2022-06-26 23:24:07 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
2007-05-29 12:29:30 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2007 by Dominic Rath *
|
|
|
|
* Dominic.Rath@gmx.de *
|
|
|
|
***************************************************************************/
|
2012-02-05 12:03:04 +00:00
|
|
|
|
2015-09-21 19:07:46 +00:00
|
|
|
#ifndef OPENOCD_TARGET_TRACE_H
|
|
|
|
#define OPENOCD_TARGET_TRACE_H
|
2007-05-29 12:29:30 +00:00
|
|
|
|
2021-04-19 20:04:30 +00:00
|
|
|
#include "helper/types.h"
|
|
|
|
|
2009-11-13 18:11:13 +00:00
|
|
|
struct target;
|
2009-11-13 21:25:47 +00:00
|
|
|
struct command_context;
|
2009-05-11 04:56:37 +00:00
|
|
|
|
2012-02-05 12:03:04 +00:00
|
|
|
struct trace_point {
|
2009-06-18 07:09:35 +00:00
|
|
|
uint32_t address;
|
2009-06-18 07:11:40 +00:00
|
|
|
uint64_t hit_counter;
|
2009-11-13 16:45:19 +00:00
|
|
|
};
|
2007-08-10 19:44:06 +00:00
|
|
|
|
2012-02-05 12:03:04 +00:00
|
|
|
struct trace {
|
2009-06-18 07:09:35 +00:00
|
|
|
uint32_t num_trace_points;
|
|
|
|
uint32_t trace_points_size;
|
2009-11-13 16:45:19 +00:00
|
|
|
struct trace_point *trace_points;
|
2009-06-18 07:09:35 +00:00
|
|
|
uint32_t trace_history_size;
|
|
|
|
uint32_t *trace_history;
|
|
|
|
uint32_t trace_history_pos;
|
2007-08-14 09:48:54 +00:00
|
|
|
int trace_history_overflowed;
|
2009-11-13 17:26:19 +00:00
|
|
|
};
|
2007-08-10 19:44:06 +00:00
|
|
|
|
2009-11-16 18:19:33 +00:00
|
|
|
/**
|
|
|
|
* \todo This enum is one of the few things in this file related
|
|
|
|
* to *hardware* tracing ... split such "real" tracing out from
|
|
|
|
* the contrib/libdcc support.
|
|
|
|
*/
|
2012-02-05 12:03:04 +00:00
|
|
|
typedef enum trace_status {
|
2007-05-29 12:29:30 +00:00
|
|
|
TRACE_IDLE = 0x0,
|
|
|
|
TRACE_RUNNING = 0x1,
|
|
|
|
TRACE_TRIGGERED = 0x2,
|
|
|
|
TRACE_COMPLETED = 0x4,
|
|
|
|
TRACE_OVERFLOWED = 0x8,
|
|
|
|
} trace_status_t;
|
|
|
|
|
2009-11-13 18:11:13 +00:00
|
|
|
int trace_point(struct target *target, uint32_t number);
|
2009-11-13 21:25:47 +00:00
|
|
|
int trace_register_commands(struct command_context *cmd_ctx);
|
2007-08-14 09:48:54 +00:00
|
|
|
|
2010-06-22 16:53:17 +00:00
|
|
|
#define ERROR_TRACE_IMAGE_UNAVAILABLE (-1500)
|
|
|
|
#define ERROR_TRACE_INSTRUCTION_UNAVAILABLE (-1501)
|
2007-06-14 09:47:00 +00:00
|
|
|
|
2015-09-21 19:07:46 +00:00
|
|
|
#endif /* OPENOCD_TARGET_TRACE_H */
|