GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
/tmp/gdb-13.1/gdb/tracectf.c File Reference
#include "defs.h"
#include "tracectf.h"
#include "tracepoint.h"
#include "regcache.h"
#include <sys/stat.h>
#include "exec.h"
#include "completer.h"
#include "inferior.h"
#include "gdbthread.h"
#include "tracefile.h"
#include <ctype.h>
#include <algorithm>
#include "gdbsupport/filestuff.h"
#include "gdbarch.h"

Go to the source code of this file.

Classes

class  ctf_target
 
struct  trace_write_handler
 
struct  ctf_trace_file_writer
 

Macros

#define CTF_MAGIC   0xC1FC1FC1
 
#define CTF_SAVE_MAJOR   1
 
#define CTF_SAVE_MINOR   8
 
#define CTF_METADATA_NAME   "metadata"
 
#define CTF_DATASTREAM_NAME   "datastream"
 
#define CTF_EVENT_ID_REGISTER   0
 
#define CTF_EVENT_ID_TSV   1
 
#define CTF_EVENT_ID_MEMORY   2
 
#define CTF_EVENT_ID_FRAME   3
 
#define CTF_EVENT_ID_STATUS   4
 
#define CTF_EVENT_ID_TSV_DEF   5
 
#define CTF_EVENT_ID_TP_DEF   6
 
#define CTF_PID   (2)
 
#define ctf_save_write_uint32(HANDLER, U32)    ctf_save_write (HANDLER, (gdb_byte *) &U32, 4)
 
#define ctf_save_write_int32(HANDLER, INT32)    ctf_save_write ((HANDLER), (gdb_byte *) &(INT32), 4)
 
#define HOST_ENDIANNESS   "le"
 

Functions

static void ctf_save_write_metadata (struct trace_write_handler *handler, const char *format,...) ATTRIBUTE_PRINTF(2
 
static int ctf_save_write (struct trace_write_handler *handler, const gdb_byte *buf, size_t size)
 
static int ctf_save_fseek (struct trace_write_handler *handler, long offset, int whence)
 
static int ctf_save_align_write (struct trace_write_handler *handler, const gdb_byte *buf, size_t size, size_t align_size)
 
static void ctf_save_next_packet (struct trace_write_handler *handler)
 
static void ctf_save_metadata_header (struct trace_write_handler *handler)
 
static void ctf_dtor (struct trace_file_writer *self)
 
static int ctf_target_save (struct trace_file_writer *self, const char *dirname)
 
static void ctf_start (struct trace_file_writer *self, const char *dirname)
 
static void ctf_write_header (struct trace_file_writer *self)
 
static void ctf_write_regblock_type (struct trace_file_writer *self, int size)
 
static void ctf_write_status (struct trace_file_writer *self, struct trace_status *ts)
 
static void ctf_write_uploaded_tsv (struct trace_file_writer *self, struct uploaded_tsv *tsv)
 
static void ctf_write_uploaded_tp (struct trace_file_writer *self, struct uploaded_tp *tp)
 
static void ctf_write_tdesc (struct trace_file_writer *self)
 
static void ctf_write_definition_end (struct trace_file_writer *self)
 
static void ctf_end (struct trace_file_writer *self)
 
static void ctf_write_frame_start (struct trace_file_writer *self, uint16_t tpnum)
 
static void ctf_write_frame_r_block (struct trace_file_writer *self, gdb_byte *buf, int32_t size)
 
static void ctf_write_frame_m_block_header (struct trace_file_writer *self, uint64_t addr, uint16_t length)
 
static void ctf_write_frame_m_block_memory (struct trace_file_writer *self, gdb_byte *buf, uint16_t length)
 
static void ctf_write_frame_v_block (struct trace_file_writer *self, int32_t num, uint64_t val)
 
static void ctf_write_frame_end (struct trace_file_writer *self)
 
struct trace_file_writerctf_trace_file_writer_new (void)
 
void _initialize_ctf ()
 

Variables

static const target_info ctf_target_info
 
static const struct trace_frame_write_ops ctf_write_frame_ops
 
static const struct trace_file_write_ops ctf_write_ops
 

Macro Definition Documentation

◆ CTF_DATASTREAM_NAME

#define CTF_DATASTREAM_NAME   "datastream"

Definition at line 102 of file tracectf.c.

◆ CTF_EVENT_ID_FRAME

#define CTF_EVENT_ID_FRAME   3

Definition at line 109 of file tracectf.c.

◆ CTF_EVENT_ID_MEMORY

#define CTF_EVENT_ID_MEMORY   2

Definition at line 108 of file tracectf.c.

◆ CTF_EVENT_ID_REGISTER

#define CTF_EVENT_ID_REGISTER   0

Definition at line 106 of file tracectf.c.

◆ CTF_EVENT_ID_STATUS

#define CTF_EVENT_ID_STATUS   4

Definition at line 110 of file tracectf.c.

◆ CTF_EVENT_ID_TP_DEF

#define CTF_EVENT_ID_TP_DEF   6

Definition at line 112 of file tracectf.c.

◆ CTF_EVENT_ID_TSV

#define CTF_EVENT_ID_TSV   1

Definition at line 107 of file tracectf.c.

◆ CTF_EVENT_ID_TSV_DEF

#define CTF_EVENT_ID_TSV_DEF   5

Definition at line 111 of file tracectf.c.

◆ CTF_MAGIC

#define CTF_MAGIC   0xC1FC1FC1

Definition at line 97 of file tracectf.c.

◆ CTF_METADATA_NAME

#define CTF_METADATA_NAME   "metadata"

Definition at line 101 of file tracectf.c.

◆ CTF_PID

#define CTF_PID   (2)

Definition at line 114 of file tracectf.c.

◆ CTF_SAVE_MAJOR

#define CTF_SAVE_MAJOR   1

Definition at line 98 of file tracectf.c.

◆ CTF_SAVE_MINOR

#define CTF_SAVE_MINOR   8

Definition at line 99 of file tracectf.c.

◆ ctf_save_write_int32

#define ctf_save_write_int32 (   HANDLER,
  INT32 
)     ctf_save_write ((HANDLER), (gdb_byte *) &(INT32), 4)

Definition at line 177 of file tracectf.c.

◆ ctf_save_write_uint32

#define ctf_save_write_uint32 (   HANDLER,
  U32 
)     ctf_save_write (HANDLER, (gdb_byte *) &U32, 4)

Definition at line 171 of file tracectf.c.

◆ HOST_ENDIANNESS

#define HOST_ENDIANNESS   "le"

Function Documentation

◆ _initialize_ctf()

void _initialize_ctf ( )

Definition at line 1727 of file tracectf.c.

Referenced by initialize_all_files().

◆ ctf_dtor()

static void ctf_dtor ( struct trace_file_writer self)
static

◆ ctf_end()

static void ctf_end ( struct trace_file_writer self)
static

Definition at line 661 of file tracectf.c.

References trace_write_handler::content_size, and ctf_trace_file_writer::tcs.

◆ ctf_save_align_write()

static int ctf_save_align_write ( struct trace_write_handler handler,
const gdb_byte *  buf,
size_t  size,
size_t  align_size 
)
static

◆ ctf_save_fseek()

static int ctf_save_fseek ( struct trace_write_handler handler,
long  offset,
int  whence 
)
static

◆ ctf_save_metadata_header()

static void ctf_save_metadata_header ( struct trace_write_handler handler)
static

Definition at line 235 of file tracectf.c.

References CTF_SAVE_MAJOR, CTF_SAVE_MINOR, ctf_save_write_metadata(), and HOST_ENDIANNESS.

Referenced by ctf_start().

◆ ctf_save_next_packet()

static void ctf_save_next_packet ( struct trace_write_handler handler)
static

◆ ctf_save_write()

static int ctf_save_write ( struct trace_write_handler handler,
const gdb_byte *  buf,
size_t  size 
)
static

◆ ctf_save_write_metadata()

static void static void ctf_save_write_metadata ( struct trace_write_handler handler,
const char *  format,
  ... 
)
static

◆ ctf_start()

static void ctf_start ( struct trace_file_writer self,
const char *  dirname 
)
static

◆ ctf_target_save()

static int ctf_target_save ( struct trace_file_writer self,
const char *  dirname 
)
static

Definition at line 332 of file tracectf.c.

◆ ctf_trace_file_writer_new()

struct trace_file_writer * ctf_trace_file_writer_new ( void  )

Definition at line 838 of file tracectf.c.

References ctf_trace_file_writer::base, ctf_write_ops, and trace_file_writer::ops.

Referenced by trace_save_ctf().

◆ ctf_write_definition_end()

static void ctf_write_definition_end ( struct trace_file_writer self)
static

◆ ctf_write_frame_end()

static void ctf_write_frame_end ( struct trace_file_writer self)
static

◆ ctf_write_frame_m_block_header()

static void ctf_write_frame_m_block_header ( struct trace_file_writer self,
uint64_t  addr,
uint16_t  length 
)
static

◆ ctf_write_frame_m_block_memory()

static void ctf_write_frame_m_block_memory ( struct trace_file_writer self,
gdb_byte *  buf,
uint16_t  length 
)
static

Definition at line 738 of file tracectf.c.

References ctf_save_align_write(), and ctf_trace_file_writer::tcs.

◆ ctf_write_frame_r_block()

static void ctf_write_frame_r_block ( struct trace_file_writer self,
gdb_byte *  buf,
int32_t  size 
)
static

◆ ctf_write_frame_start()

static void ctf_write_frame_start ( struct trace_file_writer self,
uint16_t  tpnum 
)
static

◆ ctf_write_frame_v_block()

static void ctf_write_frame_v_block ( struct trace_file_writer self,
int32_t  num,
uint64_t  val 
)
static

Definition at line 752 of file tracectf.c.

References CTF_EVENT_ID_TSV, ctf_save_align_write(), and ctf_trace_file_writer::tcs.

◆ ctf_write_header()

static void ctf_write_header ( struct trace_file_writer self)
static

◆ ctf_write_regblock_type()

static void ctf_write_regblock_type ( struct trace_file_writer self,
int  size 
)
static

◆ ctf_write_status()

static void ctf_write_status ( struct trace_file_writer self,
struct trace_status ts 
)
static

◆ ctf_write_tdesc()

static void ctf_write_tdesc ( struct trace_file_writer self)
static

Definition at line 643 of file tracectf.c.

◆ ctf_write_uploaded_tp()

static void ctf_write_uploaded_tp ( struct trace_file_writer self,
struct uploaded_tp tp 
)
static

◆ ctf_write_uploaded_tsv()

static void ctf_write_uploaded_tsv ( struct trace_file_writer self,
struct uploaded_tsv tsv 
)
static

Variable Documentation

◆ ctf_target_info

const target_info ctf_target_info
static
Initial value:
= {
"ctf",
N_("CTF file"),
N_("(Use a CTF directory as a target.\n\
Specify the filename of the CTF directory.")
}

Definition at line 39 of file tracectf.c.

Referenced by ctf_target::info().

◆ ctf_write_frame_ops

const struct trace_frame_write_ops ctf_write_frame_ops
static
Initial value:
=
{
}
static void ctf_write_frame_end(struct trace_file_writer *self)
Definition: tracectf.c:772
static void ctf_write_frame_m_block_header(struct trace_file_writer *self, uint64_t addr, uint16_t length)
Definition: tracectf.c:717
static void ctf_write_frame_v_block(struct trace_file_writer *self, int32_t num, uint64_t val)
Definition: tracectf.c:752
static void ctf_write_frame_r_block(struct trace_file_writer *self, gdb_byte *buf, int32_t size)
Definition: tracectf.c:699
static void ctf_write_frame_start(struct trace_file_writer *self, uint16_t tpnum)
Definition: tracectf.c:672
static void ctf_write_frame_m_block_memory(struct trace_file_writer *self, gdb_byte *buf, uint16_t length)
Definition: tracectf.c:738

Definition at line 806 of file tracectf.c.

◆ ctf_write_ops

const struct trace_file_write_ops ctf_write_ops
static
Initial value:
=
{
NULL,
}
static void ctf_write_tdesc(struct trace_file_writer *self)
Definition: tracectf.c:643
static void ctf_write_uploaded_tsv(struct trace_file_writer *self, struct uploaded_tsv *tsv)
Definition: tracectf.c:524
static void ctf_start(struct trace_file_writer *self, const char *dirname)
Definition: tracectf.c:344
static void ctf_write_header(struct trace_file_writer *self)
Definition: tracectf.c:380
static void ctf_write_uploaded_tp(struct trace_file_writer *self, struct uploaded_tp *tp)
Definition: tracectf.c:558
static void ctf_end(struct trace_file_writer *self)
Definition: tracectf.c:661
static const struct trace_frame_write_ops ctf_write_frame_ops
Definition: tracectf.c:806
static void ctf_write_status(struct trace_file_writer *self, struct trace_status *ts)
Definition: tracectf.c:483
static void ctf_write_regblock_type(struct trace_file_writer *self, int size)
Definition: tracectf.c:463
static int ctf_target_save(struct trace_file_writer *self, const char *dirname)
Definition: tracectf.c:332
static void ctf_dtor(struct trace_file_writer *self)
Definition: tracectf.c:315
static void ctf_write_definition_end(struct trace_file_writer *self)
Definition: tracectf.c:652

Definition at line 818 of file tracectf.c.

Referenced by ctf_trace_file_writer_new().