#include <stdio.h>#include <stdlib.h>#include <string.h>#include <iostream>#include "operf_sfile.h"#include "operf_kernel.h"#include "operf_utils.h"#include "cverb.h"#include "op_string.h"#include "operf_mangling.h"#include "operf_stats.h"#include "op_libiberty.h"
Defines | |
| #define | HASH_SIZE 2048 |
| #define | HASH_BITS (HASH_SIZE - 1) |
| #define | LRU_AMOUNT 256 |
Typedefs | |
| typedef int(* | operf_sfile_func )(struct operf_sfile *, void *) |
Functions | |
| int | operf_sfile_equal (struct operf_sfile const *sf, struct operf_sfile const *sf2) |
| struct operf_sfile * | operf_sfile_find (struct operf_transient const *trans) |
| Find the sfile for the current parameters. | |
| void | operf_sfile_dup (struct operf_sfile *to, struct operf_sfile *from) |
| void | operf_sfile_log_arc (struct operf_transient const *trans) |
| Log a callgraph arc. | |
| void | operf_sfile_log_sample (struct operf_transient const *trans) |
| Log the sample in a previously located sfile. | |
| void | operf_sfile_log_sample_count (struct operf_transient const *trans, unsigned long int count) |
| Log the event/cycle count in a previously located sfile. | |
| void | operf_sfile_clear_kernel (void) |
| clear any sfiles that are for the kernel | |
| void | operf_sfile_sync_files (void) |
| sync sample files | |
| void | operf_sfile_close_files (void) |
| close sample files | |
| int | operf_sfile_lru_clear (void) |
| clear out a certain amount of LRU entries return non-zero if the lru is already empty | |
| void | operf_sfile_get (struct operf_sfile *sf) |
| remove a sfile from the lru list, protecting it from operf_sfile_lru_clear() | |
| void | operf_sfile_put (struct operf_sfile *sf) |
| add this sfile to lru list | |
| void | operf_sfile_init (void) |
| initialise hashes | |
| #define HASH_BITS (HASH_SIZE - 1) |
| #define HASH_SIZE 2048 |
| #define LRU_AMOUNT 256 |
| typedef int(* operf_sfile_func)(struct operf_sfile *, void *) |
| void operf_sfile_clear_kernel | ( | void | ) |
clear any sfiles that are for the kernel
| void operf_sfile_close_files | ( | void | ) |
close sample files
Referenced by OP_perf_utils::op_release_resources().
| void operf_sfile_dup | ( | struct operf_sfile * | to, | |
| struct operf_sfile * | from | |||
| ) |
References operf_sfile::cg_hash, operf_sfile::files, operf_sfile::hash, operf_sfile::lru, and odb_init().
| int operf_sfile_equal | ( | struct operf_sfile const * | sf, | |
| struct operf_sfile const * | sf2 | |||
| ) |
| struct operf_sfile* operf_sfile_find | ( | struct operf_transient const * | trans | ) | [read] |
Find the sfile for the current parameters.
Note that is required that the PC value be set appropriately (needed for kernel images)
References operf_transient::app_filename, operf_transient::app_len, operf_transient::cpu, cverb, operf_sfile::hash, operf_transient::image_len, operf_transient::image_name, operf_transient::in_kernel, operf_transient::is_anon, list_entry, list_for_each, operf_find_kernel_image(), OPERF_LOST_KERNEL, operf_sfile_get(), operf_sfile_put(), operf_stats, operf_transient::pc, operf_transient::tgid, operf_transient::tid, and vsfile.
| void operf_sfile_get | ( | struct operf_sfile * | sf | ) |
remove a sfile from the lru list, protecting it from operf_sfile_lru_clear()
References operf_sfile::lru.
Referenced by operf_open_sample_file(), and operf_sfile_find().
| void operf_sfile_init | ( | void | ) |
| void operf_sfile_log_arc | ( | struct operf_transient const * | trans | ) |
Log a callgraph arc.
References operf_transient::current, cverb, operf_sfile::is_anon, operf_sfile::kernel, operf_transient::last, operf_transient::last_pc, odb_update_node(), OPERF_LOST_SAMPLEFILE, operf_stats, operf_transient::pc, operf_kernel_image::start, operf_sfile::start_addr, and varcs.
| void operf_sfile_log_sample | ( | struct operf_transient const * | trans | ) |
Log the sample in a previously located sfile.
References operf_sfile_log_sample_count().
| void operf_sfile_log_sample_count | ( | struct operf_transient const * | trans, | |
| unsigned long int | count | |||
| ) |
Log the event/cycle count in a previously located sfile.
References operf_transient::current, cverb, operf_transient::in_kernel, operf_sfile::is_anon, operf_sfile::kernel, odb_update_node_with_offset(), OPERF_KERNEL, OPERF_LOST_SAMPLEFILE, OPERF_PROCESS, OPERF_SAMPLES, operf_stats, operf_transient::pc, operf_kernel_image::start, operf_sfile::start_addr, and vsfile.
Referenced by operf_sfile_log_sample().
| int operf_sfile_lru_clear | ( | void | ) |
clear out a certain amount of LRU entries return non-zero if the lru is already empty
References list_entry, list_for_each_safe, operf_sfile::lru, and LRU_AMOUNT.
Referenced by operf_open_sample_file().
| void operf_sfile_put | ( | struct operf_sfile * | sf | ) |
add this sfile to lru list
References operf_sfile::lru.
Referenced by operf_open_sample_file(), and operf_sfile_find().
| void operf_sfile_sync_files | ( | void | ) |
sync sample files
1.6.1