Add a mapping from a running process
Synopsis:
#include <sys/dcmd_prof.h>
#define DCMD_PROF_MAPPING_ADD __DIOT(_DCMD_MISC, PROF_MAPPING_ADD, struct __prof_clientinfo)
Arguments to devctl():
Argument |
Value |
filedes |
A file descriptor for the profiler that you obtained by opening /dev/profiler. |
dcmd |
DCMD_PROF_MAPPING_ADD |
dev_data_ptr |
A pointer to a struct __prof_clientinfo (see
DCMD_PROF_ATTACH), optionally followed by the name of the mapping identifier.
|
n_bytes |
sizeof(struct __prof_clientinfo) plus the length of the name |
dev_info_ptr |
NULL |
Description:
This command adds a mapping from a running process.
Input:
Initialize the structure to 0, and then:
- Set the cmd member to PROF_CMD_ADD_MAPPING, ORing
in PROF_CMD_ARCS or PROF_CMD_ARCS_2, depending on the type of arcs (see
DCMD_PROF_ATTACH).
- Set lowpc and highpc to the low and high addresses
for the mapping.
- Specify the offsets and sizes of the froms and tos structures.
- Specify the hash_frac member.
This represents the fraction of text space to allocate for the from hash buckets.
The value is based on the minimum number of bytes of separation between two subroutine
call points in the object code.
A value of 2 saves a reasonable amount of space for profiling data structures without
(in practice) sacrificing any granularity.
- Optionally specify an integer to use as the shmem_key member.
- Optionally provide a name of the mapping identifier.
See also:
devctl()
in the QNX Neutrino C Library Reference