Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
trace-seq.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "event-parse.h"
#include "event-utils.h"

Go to the source code of this file.

Macros

#define TRACE_SEQ_POISON   ((void *)0xdeadbeef)
 
#define TRACE_SEQ_CHECK(s)
 

Functions

void trace_seq_init (struct trace_seq *s)
 
void trace_seq_destroy (struct trace_seq *s)
 
int trace_seq_printf (struct trace_seq *s, const char *fmt,...)
 
int trace_seq_vprintf (struct trace_seq *s, const char *fmt, va_list args)
 
int trace_seq_puts (struct trace_seq *s, const char *str)
 
int trace_seq_putc (struct trace_seq *s, unsigned char c)
 
void trace_seq_terminate (struct trace_seq *s)
 
int trace_seq_do_printf (struct trace_seq *s)
 

Macro Definition Documentation

#define TRACE_SEQ_CHECK (   s)
Value:
do { \
if ((s)->buffer == TRACE_SEQ_POISON) \
die("Usage of trace_seq after it was destroyed"); \
} while (0)

Definition at line 34 of file trace-seq.c.

#define TRACE_SEQ_POISON   ((void *)0xdeadbeef)

Definition at line 33 of file trace-seq.c.

Function Documentation

void trace_seq_destroy ( struct trace_seq s)

trace_seq_destroy - free up memory of a trace_seq : a pointer to the trace_seq to free the buffer

Only frees the buffer, not the trace_seq struct itself.

Definition at line 58 of file trace-seq.c.

int trace_seq_do_printf ( struct trace_seq s)

Definition at line 196 of file trace-seq.c.

void trace_seq_init ( struct trace_seq s)

trace_seq_init - initialize the trace_seq structure : a pointer to the trace_seq structure to initialize

Definition at line 44 of file trace-seq.c.

int trace_seq_printf ( struct trace_seq s,
const char fmt,
  ... 
)

trace_seq_printf - sequence printing of trace information : trace sequence descriptor : printf format string

It returns 0 if the trace oversizes the buffer's free space, 1 otherwise.

The tracer may use either sequence operations or its own copy to user routines. To simplify formating of a trace trace_seq_printf is used to store strings into a special buffer (). Then the output may be either used by the sequencer or pulled into another buffer.

Definition at line 90 of file trace-seq.c.

int trace_seq_putc ( struct trace_seq s,
unsigned char  c 
)

Definition at line 176 of file trace-seq.c.

int trace_seq_puts ( struct trace_seq s,
const char str 
)

trace_seq_puts - trace sequence printing of simple string : trace sequence descriptor : simple string to record

The tracer may use either the sequence operations or its own copy to user routines. This function records a simple string into a special buffer () for later retrieval by a sequencer or other mechanism.

Definition at line 159 of file trace-seq.c.

void trace_seq_terminate ( struct trace_seq s)

Definition at line 188 of file trace-seq.c.

int trace_seq_vprintf ( struct trace_seq s,
const char fmt,
va_list  args 
)

trace_seq_vprintf - sequence printing of trace information : trace sequence descriptor : printf format string

The tracer may use either sequence operations or its own copy to user routines. To simplify formating of a trace trace_seq_printf is used to store strings into a special buffer (). Then the output may be either used by the sequencer or pulled into another buffer.

Definition at line 127 of file trace-seq.c.