#include "config.h"
#include "opd_proc.h"
#include "opd_mapping.h"
#include "opd_24_stats.h"
#include "opd_sample_files.h"
#include "opd_image.h"
#include "opd_parse_proc.h"
#include "opd_kernel.h"
#include "opd_printf.h"
#include "oprofiled.h"
#include "op_sample_file.h"
#include "op_config_24.h"
#include "op_interface.h"
#include "op_libiberty.h"
#include "op_deviceio.h"
#include "op_events.h"
#include "op_get_time.h"
#include "op_fileio.h"
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
Go to the source code of this file.
Functions | |
static void | opd_sighup (void) |
static void | opd_alarm (void) |
static void | opd_sigterm (void) |
static void | op_open_files (void) |
static void | opd_do_samples (struct op_buffer_head const *buf) |
static void | opd_do_notes (struct op_note const *opd_buf, size_t count) |
static void | opd_shutdown (struct op_buffer_head *buf, size_t size, struct op_note *nbuf, size_t nsize) |
static void | opd_do_read (struct op_buffer_head *buf, size_t size, struct op_note *nbuf, size_t nsize) |
static void | clean_exit (void) |
static void | opd_24_init (void) |
static void | opd_24_start (void) |
static void | opd_24_exit (void) |
Variables | |
fd_t | hashmapdevfd |
int | cpu_number |
static fd_t | devfd |
static fd_t | notedevfd |
static struct op_buffer_head * | sbuf |
static size_t | s_buf_bytesize |
static struct op_note * | nbuf |
static size_t | n_buf_bytesize |
struct oprofiled_ops | opd_24_ops |
Daemon set up and main loop for 2.4
Definition in file init.c.
static void clean_exit | ( | void | ) | [static] |
Definition at line 309 of file init.c.
References op_free_events(), op_lock_file, and opd_cleanup_hash_name().
Referenced by opd_24_init().
static void op_open_files | ( | void | ) | [static] |
op_open_files - open necessary files
Open the device files and the log file, and mmap() the hash map.
Definition at line 61 of file init.c.
References devfd, hashmapdevfd, notedevfd, op_device, op_get_time(), op_hash_device, op_log_file, op_note_device, op_open_device(), opd_init_hash_map(), and opd_open_logfile().
Referenced by opd_24_start().
static void opd_24_exit | ( | void | ) | [static] |
Definition at line 369 of file init.c.
References op_get_time(), opd_clear_module_info(), opd_delete_image(), opd_for_each_image(), opd_print_24_stats(), and opd_proc_cleanup().
static void opd_24_init | ( | void | ) | [static] |
Definition at line 325 of file init.c.
References clean_exit(), kernel_range, n_buf_bytesize, no_vmlinux, OP_DEFAULT_BUF_SIZE, OP_DEFAULT_NOTE_SIZE, OP_MOUNT, opd_24_stats, opd_init_images(), opd_init_kernel_image(), opd_init_procs(), OPD_MAX_STATS, opd_parse_kernel_range(), opd_read_fs_int(), and s_buf_bytesize.
static void opd_24_start | ( | void | ) | [static] |
Definition at line 357 of file init.c.
References n_buf_bytesize, op_open_files(), opd_do_read(), opd_get_ascii_procs(), and s_buf_bytesize.
static void opd_alarm | ( | void | ) | [static] |
opd_alarm - clean up old procs, msync, and report stats
Definition at line 285 of file init.c.
References opd_age_procs(), opd_print_24_stats(), and opd_sync_samples_files().
Referenced by opd_do_read().
static void opd_do_notes | ( | struct op_note const * | opd_buf, | |
size_t | count | |||
) | [static] |
opd_do_notes - process a notes buffer
opd_buf | buffer to process | |
count | number of bytes in buffer |
Process a buffer of notes.
Definition at line 212 of file init.c.
References OP_DROP_MODULES, OP_EXEC, OP_EXIT, OP_FORK, OP_MAP, opd_24_stats, opd_clear_module_info(), opd_handle_exec(), opd_handle_exit(), opd_handle_fork(), opd_handle_mapping(), OPD_NOTIFICATIONS, op_note::pid, op_note::tgid, and op_note::type.
Referenced by opd_do_read(), and opd_shutdown().
static void opd_do_read | ( | struct op_buffer_head * | buf, | |
size_t | size, | |||
struct op_note * | nbuf, | |||
size_t | nsize | |||
) | [static] |
opd_do_read - enter processing loop
buf | buffer to read into | |
size | size of buffer | |
nbuf | note buffer | |
nsize | size of note buffer |
Read some of a buffer from the device and process the contents.
Definition at line 165 of file init.c.
References devfd, notedevfd, op_read_device(), opd_alarm(), opd_do_notes(), opd_do_samples(), opd_shutdown(), opd_sighup(), opd_sigterm(), signal_alarm, signal_hup, signal_term, op_buffer_head::state, STOPPING, verbprintf, and vmisc.
Referenced by opd_24_start().
static void opd_do_samples | ( | struct op_buffer_head const * | opd_buf | ) | [static] |
opd_do_samples - process a sample buffer
opd_buf | buffer to process |
Process a buffer of samples. The signals specified by the global variable maskset are masked.
If the sample could be processed correctly, it is written to the relevant sample file. Additionally mapping and process notifications are handled here.
Definition at line 262 of file init.c.
References op_buffer_head::buffer, buffer, op_buffer_head::count, op_buffer_head::cpu_nr, cpu_number, op_sample::eip, opd_24_stats, OPD_DUMP_COUNT, opd_put_sample(), pid, separate_cpu, verbprintf, vmisc, and vsamples.
Referenced by opd_do_read(), and opd_shutdown().
static void opd_shutdown | ( | struct op_buffer_head * | buf, | |
size_t | size, | |||
struct op_note * | nbuf, | |||
size_t | nsize | |||
) | [static] |
do_shutdown - shutdown cleanly, reading as much remaining data as possible.
buf | sample buffer area | |
size | size of sample buffer | |
nbuf | note buffer area | |
nsize | size of note buffer |
Definition at line 120 of file init.c.
References devfd, notedevfd, op_read_device(), opd_do_notes(), opd_do_samples(), op_buffer_head::state, verbprintf, and vmisc.
Referenced by opd_do_read().
static void opd_sighup | ( | void | ) | [static] |
Definition at line 298 of file init.c.
References opd_close_image_samples_files(), opd_for_each_image(), and opd_open_logfile().
Referenced by opd_do_read().
static void opd_sigterm | ( | void | ) | [static] |
Definition at line 317 of file init.c.
References op_get_time(), and opd_print_24_stats().
Referenced by opd_do_read().
int cpu_number |
Definition at line 41 of file init.c.
Referenced by opd_do_samples(), and opd_put_image_sample().
Definition at line 43 of file init.c.
Referenced by op_open_files(), opd_do_read(), and opd_shutdown().
Definition at line 39 of file init.c.
Referenced by op_open_files(), and opd_init_hash_map().
size_t n_buf_bytesize [static] |
Definition at line 48 of file init.c.
Referenced by opd_24_init(), and opd_24_start().
Definition at line 44 of file init.c.
Referenced by op_open_files(), opd_do_read(), and opd_shutdown().
struct oprofiled_ops opd_24_ops |
{ .init = opd_24_init, .start = opd_24_start, .exit = opd_24_exit }
Definition at line 383 of file init.c.
Referenced by get_ops().
size_t s_buf_bytesize [static] |
Definition at line 46 of file init.c.
Referenced by opd_24_init(), and opd_24_start().
struct op_buffer_head* sbuf [static] |