#include <sys/types.h>
#include "opd_sample_files.h"
#include "opd_image.h"
#include "opd_printf.h"
#include "opd_events.h"
#include "oprofiled.h"
#include "op_sample_file.h"
#include "op_file.h"
#include "op_config.h"
#include "op_mangle.h"
#include "op_events.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
Go to the source code of this file.
Defines | |
#define | LRU_AMOUNT 1000 |
Functions | |
static | LIST_HEAD (lru_list) |
static int | opd_24_sfile_lru_clear (void) |
void | opd_24_sfile_lru (struct opd_24_sfile *sfile) |
static char * | opd_mangle_filename (struct opd_image const *image, int counter, int cpu_nr) |
int | opd_open_24_sample_file (struct opd_image *image, int counter, int cpu_nr) |
void | opd_sync_samples_files (void) |
void | opd_close_image_samples_files (struct opd_image *image) |
Management of sample files
Definition in file opd_sample_files.c.
#define LRU_AMOUNT 1000 |
Definition at line 35 of file opd_sample_files.c.
Referenced by do_lru(), opd_24_sfile_lru_clear(), operf_sfile_lru_clear(), and sfile_lru_clear().
static LIST_HEAD | ( | lru_list | ) | [static] |
All sfiles are on this list.
void opd_24_sfile_lru | ( | struct opd_24_sfile * | sfile | ) |
sfile | sample file to act on |
put sfile at the head of samples files lru list
Definition at line 60 of file opd_sample_files.c.
References list_add_tail(), list_del(), and opd_24_sfile::lru_next.
Referenced by opd_put_image_sample().
static int opd_24_sfile_lru_clear | ( | void | ) | [static] |
Definition at line 36 of file opd_sample_files.c.
References list_del_init(), list_empty(), list_entry, list_for_each_safe, LRU_AMOUNT, opd_24_sfile::lru_next, odb_close(), opd_24_sfile::sample_file, verbprintf, and vsfile.
Referenced by opd_open_24_sample_file().
void opd_close_image_samples_files | ( | struct opd_image * | image | ) |
image | the image pointer to work on |
close all samples files belonging to this image
Definition at line 166 of file opd_sample_files.c.
References list_del(), opd_24_sfile::lru_next, NR_CPUS, odb_close(), op_nr_counters, opd_24_sfile::sample_file, and opd_image::sfiles.
Referenced by opd_delete_image(), and opd_sighup().
static char* opd_mangle_filename | ( | struct opd_image const * | image, | |
int | counter, | |||
int | cpu_nr | |||
) | [static] |
Definition at line 67 of file opd_sample_files.c.
References opd_image::app_name, mangle_values::count, mangle_values::cpu, mangle_values::dep_name, mangle_values::event_name, find_counter_event(), mangle_values::flags, mangle_values::image_name, opd_image::kernel, MANGLE_CPU, MANGLE_KERNEL, MANGLE_TGID, MANGLE_TID, opd_image::name, op_mangle_filename(), separate_cpu, separate_lib, separate_thread, opd_image::tgid, mangle_values::tgid, opd_image::tid, mangle_values::tid, and mangle_values::unit_mask.
Referenced by opd_open_24_sample_file().
int opd_open_24_sample_file | ( | struct opd_image * | image, | |
int | counter, | |||
int | cpu_nr | |||
) |
opd_open_24_sample_file - open an image sample file
image | image to open file for | |
counter | counter number | |
cpu_nr | cpu number |
Open image sample file for the image, counter counter and set up memory mappings for it. image->kernel and image->name must have meaningful values.
Returns 0 on success.
Definition at line 103 of file opd_sample_files.c.
References create_path(), fill_header(), opd_image::kernel, list_add_tail(), list_del(), list_init(), opd_24_sfile::lru_next, opd_image::mtime, odb_get_data(), odb_init(), odb_open(), ODB_RDWR, opd_24_sfile_lru_clear(), opd_mangle_filename(), opd_24_sfile::sample_file, opd_image::sfiles, verbprintf, and vsfile.
Referenced by opd_put_image_sample().
void opd_sync_samples_files | ( | void | ) |
sync all samples files
Definition at line 154 of file opd_sample_files.c.
References list_entry, list_for_each, opd_24_sfile::lru_next, odb_sync(), and opd_24_sfile::sample_file.
Referenced by opd_alarm().