Linux Perf
json.h File Reference
#include "jsmn.h"
#include <stdbool.h>
Include dependency graph for json.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   fmt
 
#define pr_err(fmt, ...)   eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_info(fmt, ...)   eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_debug(fmt, ...)   eprintf(2, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 
#define roundup(x, y)
 

Functions

jsmntok_tparse_json (const char *fn, char **map, size_t *size, int *len)
 
void free_json (char *map, size_t size, jsmntok_t *tokens)
 
int json_line (char *map, jsmntok_t *t)
 
const char * json_name (jsmntok_t *t)
 
int json_streq (char *map, jsmntok_t *t, const char *s)
 
int json_len (jsmntok_t *t)
 
int eprintf (int level, int var, const char *fmt,...)
 

Variables

int verbose
 

Macro Definition Documentation

◆ pr_debug

#define pr_debug (   fmt,
  ... 
)    eprintf(2, verbose, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 27 of file json.h.

◆ pr_err

#define pr_err (   fmt,
  ... 
)    eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 21 of file json.h.

◆ pr_fmt

#define pr_fmt (   fmt)    fmt

Definition at line 19 of file json.h.

◆ pr_info

#define pr_info (   fmt,
  ... 
)    eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 24 of file json.h.

◆ roundup

#define roundup (   x,
 
)
Value:
( \
{ \
const typeof(y) __y = y; \
(((x) + (__y - 1)) / __y) * __y; \
} \
)

Definition at line 31 of file json.h.

Function Documentation

◆ eprintf()

int eprintf ( int  level,
int  var,
const char *  fmt,
  ... 
)

Definition at line 56 of file jevents.c.

Here is the call graph for this function:

◆ free_json()

void free_json ( char *  map,
size_t  size,
jsmntok_t tokens 
)

Definition at line 115 of file json.c.

Here is the call graph for this function:

◆ json_len()

int json_len ( jsmntok_t t)

Definition at line 152 of file json.c.

◆ json_line()

int json_line ( char *  map,
jsmntok_t t 
)

Definition at line 132 of file json.c.

Here is the call graph for this function:

◆ json_name()

const char* json_name ( jsmntok_t t)

Definition at line 147 of file json.c.

◆ json_streq()

int json_streq ( char *  map,
jsmntok_t t,
const char *  s 
)

Definition at line 158 of file json.c.

Here is the call graph for this function:

◆ parse_json()

jsmntok_t* parse_json ( const char *  fn,
char **  map,
size_t *  size,
int *  len 
)

Definition at line 83 of file json.c.

Here is the call graph for this function:

Variable Documentation

◆ verbose

int verbose

Definition at line 53 of file jevents.c.