HPCToolkit
server.cpp File Reference
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <err.h>
#include <errno.h>
#include <setjmp.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "code-ranges.h"
#include "function-entries.h"
#include "variable-entries.h"
#include "process-ranges.h"
#include "server.h"
#include "syserv-mesg.h"
Include dependency graph for server.cpp:

Go to the source code of this file.

Macros

#define ADDR_SIZE   (256 * 1024)
 
#define INIT_INBUF_SIZE   2000
 
#define SUCCESS   0
 
#define FAILURE   -1
 
#define END_OF_FILE   -2
 

Functions

static int read_all (int fd, void *buf, size_t count)
 
static int write_all (int fd, const void *buf, size_t count)
 
static int read_mesg (struct syserv_mesg *mesg)
 
static int write_mesg (int32_t type, int64_t len)
 
void syserv_add_addr (void *addr, long func_entry_map_size)
 
void syserv_add_header (int is_relocatable, uintptr_t ref_offset)
 
static void signal_handler (int sig)
 
static void signal_handler_init (void)
 
static void do_query (DiscoverFnTy fn_discovery, struct syserv_mesg *mesg)
 
static void do_query_var (DiscoverFnTy fn_discovery, struct syserv_mesg *mesg)
 
void system_server (DiscoverFnTy fn_discovery, int fd1, int fd2)
 

Variables

static int fdin
 
static int fdout
 
static void * addr_buf [ADDR_SIZE]
 
static long num_addrs
 
static long total_num_addrs
 
static long max_num_addrs
 
static char * inbuf
 
static long inbuf_size
 
static struct syserv_fnbounds_info fnb_info
 
static int jmpbuf_ok = 0
 
static sigjmp_buf jmpbuf
 
static int sent_ok_mesg
 

Macro Definition Documentation

◆ ADDR_SIZE

#define ADDR_SIZE   (256 * 1024)

Definition at line 97 of file server.cpp.

◆ END_OF_FILE

#define END_OF_FILE   -2

Definition at line 102 of file server.cpp.

◆ FAILURE

#define FAILURE   -1

Definition at line 101 of file server.cpp.

◆ INIT_INBUF_SIZE

#define INIT_INBUF_SIZE   2000

Definition at line 98 of file server.cpp.

◆ SUCCESS

#define SUCCESS   0

Definition at line 100 of file server.cpp.

Function Documentation

◆ do_query()

static void do_query ( DiscoverFnTy  fn_discovery,
struct syserv_mesg mesg 
)
static

Definition at line 306 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_query_var()

static void do_query_var ( DiscoverFnTy  fn_discovery,
struct syserv_mesg mesg 
)
static

Definition at line 390 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_all()

static int read_all ( int  fd,
void *  buf,
size_t  count 
)
static

Definition at line 131 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_mesg()

static int read_mesg ( struct syserv_mesg mesg)
static

Definition at line 182 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ signal_handler()

static void signal_handler ( int  sig)
static

Definition at line 261 of file server.cpp.

Here is the caller graph for this function:

◆ signal_handler_init()

static void signal_handler_init ( void  )
static

Definition at line 278 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ syserv_add_addr()

void syserv_add_addr ( void *  addr,
long  func_entry_map_size 
)

Definition at line 218 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ syserv_add_header()

void syserv_add_header ( int  is_relocatable,
uintptr_t  ref_offset 
)

Definition at line 249 of file server.cpp.

Here is the caller graph for this function:

◆ system_server()

void system_server ( DiscoverFnTy  fn_discovery,
int  fd1,
int  fd2 
)

Definition at line 470 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_all()

static int write_all ( int  fd,
const void *  buf,
size_t  count 
)
static

Definition at line 158 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_mesg()

static int write_mesg ( int32_t  type,
int64_t  len 
)
static

Definition at line 200 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ addr_buf

void* addr_buf[ADDR_SIZE]
static

Definition at line 107 of file server.cpp.

◆ fdin

int fdin
static

Definition at line 104 of file server.cpp.

◆ fdout

int fdout
static

Definition at line 105 of file server.cpp.

◆ fnb_info

struct syserv_fnbounds_info fnb_info
static

Definition at line 115 of file server.cpp.

◆ inbuf

char* inbuf
static

Definition at line 112 of file server.cpp.

◆ inbuf_size

long inbuf_size
static

Definition at line 113 of file server.cpp.

◆ jmpbuf

sigjmp_buf jmpbuf
static

Definition at line 118 of file server.cpp.

◆ jmpbuf_ok

int jmpbuf_ok = 0
static

Definition at line 117 of file server.cpp.

◆ max_num_addrs

long max_num_addrs
static

Definition at line 110 of file server.cpp.

◆ num_addrs

long num_addrs
static

Definition at line 108 of file server.cpp.

◆ sent_ok_mesg

int sent_ok_mesg
static

Definition at line 120 of file server.cpp.

◆ total_num_addrs

long total_num_addrs
static

Definition at line 109 of file server.cpp.