GDB (xrefs)
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/ctf.c File Reference
#include "defs.h"
#include "ctf.h"
#include "tracepoint.h"
#include "regcache.h"
#include "gdb_stat.h"
#include "exec.h"
#include "completer.h"
#include <ctype.h>

Go to the source code of this file.

Classes

struct  trace_write_handler
struct  ctf_trace_file_writer

Defines

#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_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"
#define CTF_FILE_MIN_SIZE   4096

Functions

static void ctf_save_write_metadata (struct trace_write_handler *handler, const char *format,...)
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_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 (void)

Variables

static struct trace_frame_write_ops ctf_write_frame_ops
static struct trace_file_write_ops ctf_write_ops
initialize_file_ftype _initialize_ctf

Define Documentation

#define CTF_DATASTREAM_NAME   "datastream"

Definition at line 67 of file ctf.c.

Referenced by ctf_start().

#define CTF_EVENT_ID_FRAME   3

Definition at line 74 of file ctf.c.

Referenced by ctf_write_frame_start(), and ctf_write_header().

#define CTF_EVENT_ID_MEMORY   2

Definition at line 73 of file ctf.c.

Referenced by ctf_write_frame_m_block_header(), and ctf_write_header().

#define CTF_EVENT_ID_REGISTER   0

Definition at line 71 of file ctf.c.

Referenced by ctf_write_frame_r_block(), and ctf_write_regblock_type().

#define CTF_EVENT_ID_STATUS   4

Definition at line 75 of file ctf.c.

Referenced by ctf_write_status().

#define CTF_EVENT_ID_TP_DEF   6

Definition at line 77 of file ctf.c.

Referenced by ctf_write_header(), and ctf_write_uploaded_tp().

#define CTF_EVENT_ID_TSV   1

Definition at line 72 of file ctf.c.

Referenced by ctf_write_frame_v_block(), and ctf_write_header().

#define CTF_EVENT_ID_TSV_DEF   5

Definition at line 76 of file ctf.c.

Referenced by ctf_write_header(), and ctf_write_uploaded_tsv().

#define CTF_FILE_MIN_SIZE   4096

Definition at line 635 of file ctf.c.

Referenced by ctf_end().

#define CTF_MAGIC   0xC1FC1FC1

Definition at line 62 of file ctf.c.

Referenced by ctf_end(), and ctf_write_frame_start().

#define CTF_METADATA_NAME   "metadata"

Definition at line 66 of file ctf.c.

Referenced by ctf_start().

#define CTF_SAVE_MAJOR   1

Definition at line 63 of file ctf.c.

Referenced by ctf_save_metadata_header().

#define CTF_SAVE_MINOR   8

Definition at line 64 of file ctf.c.

Referenced by ctf_save_metadata_header().

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

Definition at line 135 of file ctf.c.

Referenced by ctf_write_status(), ctf_write_uploaded_tp(), and ctf_write_uploaded_tsv().

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

Definition at line 129 of file ctf.c.

Referenced by ctf_end(), ctf_write_frame_end(), and ctf_write_frame_start().

#define HOST_ENDIANNESS   "le"

Function Documentation

void _initialize_ctf ( void  )

Definition at line 1857 of file ctf.c.

References add_target_with_completer().

static void ctf_dtor ( struct trace_file_writer self) [static]
static void ctf_end ( struct trace_file_writer self) [static]
static int ctf_save_align_write ( struct trace_write_handler handler,
const gdb_byte buf,
size_t  size,
size_t  align_size 
) [static]
static int ctf_save_fseek ( struct trace_write_handler handler,
long  offset,
int  whence 
) [static]
static void ctf_save_metadata_header ( struct trace_write_handler handler) [static]

Definition at line 193 of file ctf.c.

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

Referenced by ctf_start().

static void ctf_save_next_packet ( struct trace_write_handler handler) [static]
static int ctf_save_write ( struct trace_write_handler handler,
const gdb_byte buf,
size_t  size 
) [static]
static void ctf_save_write_metadata ( struct trace_write_handler handler,
const char *  format,
  ... 
) [static]
static void ctf_start ( struct trace_file_writer self,
const char *  dirname 
) [static]
static int ctf_target_save ( struct trace_file_writer self,
const char *  dirname 
) [static]

Definition at line 292 of file ctf.c.

struct trace_file_writer* ctf_trace_file_writer_new ( void  ) [read]
static void ctf_write_definition_end ( struct trace_file_writer self) [static]

Definition at line 624 of file ctf.c.

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

Definition at line 741 of file ctf.c.

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

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

Definition at line 762 of file ctf.c.

References ctf_save_align_write(), and ctf_trace_file_writer::tcs.

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

Definition at line 723 of file ctf.c.

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

static void ctf_write_frame_start ( struct trace_file_writer self,
uint16_t  tpnum 
) [static]
static void ctf_write_frame_v_block ( struct trace_file_writer self,
int32_t  num,
uint64_t  val 
) [static]

Definition at line 776 of file ctf.c.

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

static void ctf_write_header ( struct trace_file_writer self) [static]
static void ctf_write_regblock_type ( struct trace_file_writer self,
int  size 
) [static]
static void ctf_write_status ( struct trace_file_writer self,
struct trace_status ts 
) [static]
static void ctf_write_uploaded_tp ( struct trace_file_writer self,
struct uploaded_tp tp 
) [static]
static void ctf_write_uploaded_tsv ( struct trace_file_writer self,
struct uploaded_tsv tsv 
) [static]

Variable Documentation

Referenced by initialize_all_files().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines