Linux Perf
thread_map.c File Reference
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "string2.h"
#include "strlist.h"
#include <string.h>
#include <api/fs/fs.h>
#include "asm/bug.h"
#include "thread_map.h"
#include "util.h"
#include "debug.h"
#include "event.h"
Include dependency graph for thread_map.c:

Go to the source code of this file.

Macros

#define thread_map__alloc(__nr)   thread_map__realloc(NULL, __nr)
 

Functions

static int filter (const struct dirent *dir)
 
static void thread_map__reset (struct thread_map *map, int start, int nr)
 
static struct thread_mapthread_map__realloc (struct thread_map *map, int nr)
 
struct thread_mapthread_map__new_by_pid (pid_t pid)
 
struct thread_mapthread_map__new_by_tid (pid_t tid)
 
static struct thread_map__thread_map__new_all_cpus (uid_t uid)
 
struct thread_mapthread_map__new_all_cpus (void)
 
struct thread_mapthread_map__new_by_uid (uid_t uid)
 
struct thread_mapthread_map__new (pid_t pid, pid_t tid, uid_t uid)
 
static struct thread_mapthread_map__new_by_pid_str (const char *pid_str)
 
struct thread_mapthread_map__new_dummy (void)
 
struct thread_mapthread_map__new_by_tid_str (const char *tid_str)
 
struct thread_mapthread_map__new_str (const char *pid, const char *tid, uid_t uid, bool all_threads)
 
static void thread_map__delete (struct thread_map *threads)
 
struct thread_mapthread_map__get (struct thread_map *map)
 
void thread_map__put (struct thread_map *map)
 
size_t thread_map__fprintf (struct thread_map *threads, FILE *fp)
 
static int get_comm (char **comm, pid_t pid)
 
static void comm_init (struct thread_map *map, int i)
 
void thread_map__read_comms (struct thread_map *threads)
 
static void thread_map__copy_event (struct thread_map *threads, struct thread_map_event *event)
 
struct thread_mapthread_map__new_event (struct thread_map_event *event)
 
bool thread_map__has (struct thread_map *threads, pid_t pid)
 
int thread_map__remove (struct thread_map *threads, int idx)
 

Macro Definition Documentation

◆ thread_map__alloc

#define thread_map__alloc (   __nr)    thread_map__realloc(NULL, __nr)

Definition at line 53 of file thread_map.c.

Function Documentation

◆ __thread_map__new_all_cpus()

static struct thread_map* __thread_map__new_all_cpus ( uid_t  uid)
static

Definition at line 96 of file thread_map.c.

Here is the call graph for this function:

◆ comm_init()

static void comm_init ( struct thread_map map,
int  i 
)
static

Definition at line 402 of file thread_map.c.

Here is the call graph for this function:

◆ filter()

static int filter ( const struct dirent *  dir)
static

Definition at line 22 of file thread_map.c.

◆ get_comm()

static int get_comm ( char **  comm,
pid_t  pid 
)
static

Definition at line 378 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__copy_event()

static void thread_map__copy_event ( struct thread_map threads,
struct thread_map_event event 
)
static

Definition at line 431 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__delete()

static void thread_map__delete ( struct thread_map threads)
static

Definition at line 341 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__fprintf()

size_t thread_map__fprintf ( struct thread_map threads,
FILE *  fp 
)

Definition at line 367 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__get()

struct thread_map* thread_map__get ( struct thread_map map)

Definition at line 354 of file thread_map.c.

◆ thread_map__has()

bool thread_map__has ( struct thread_map threads,
pid_t  pid 
)

Definition at line 457 of file thread_map.c.

◆ thread_map__new()

struct thread_map* thread_map__new ( pid_t  pid,
pid_t  tid,
uid_t  uid 
)

Definition at line 192 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__new_all_cpus()

struct thread_map* thread_map__new_all_cpus ( void  )

Definition at line 182 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__new_by_pid()

struct thread_map* thread_map__new_by_pid ( pid_t  pid)

Definition at line 55 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__new_by_pid_str()

static struct thread_map* thread_map__new_by_pid_str ( const char *  pid_str)
static

Definition at line 203 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__new_by_tid()

struct thread_map* thread_map__new_by_tid ( pid_t  tid)

Definition at line 83 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__new_by_tid_str()

struct thread_map* thread_map__new_by_tid_str ( const char *  tid_str)

Definition at line 277 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__new_by_uid()

struct thread_map* thread_map__new_by_uid ( uid_t  uid)

Definition at line 187 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__new_dummy()

struct thread_map* thread_map__new_dummy ( void  )

Definition at line 265 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__new_event()

struct thread_map* thread_map__new_event ( struct thread_map_event event)

Definition at line 446 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__new_str()

struct thread_map* thread_map__new_str ( const char *  pid,
const char *  tid,
uid_t  uid,
bool  all_threads 
)

Definition at line 326 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__put()

void thread_map__put ( struct thread_map map)

Definition at line 361 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__read_comms()

void thread_map__read_comms ( struct thread_map threads)

Definition at line 423 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__realloc()

static struct thread_map* thread_map__realloc ( struct thread_map map,
int  nr 
)
static

Definition at line 38 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__remove()

int thread_map__remove ( struct thread_map threads,
int  idx 
)

Definition at line 469 of file thread_map.c.

Here is the call graph for this function:

◆ thread_map__reset()

static void thread_map__reset ( struct thread_map map,
int  start,
int  nr 
)
static

Definition at line 30 of file thread_map.c.

Here is the call graph for this function: