opd_sfile.c File Reference

Management of sample files. More...

#include "opd_sfile.h"
#include "opd_trans.h"
#include "opd_kernel.h"
#include "opd_mangling.h"
#include "opd_anon.h"
#include "opd_printf.h"
#include "opd_stats.h"
#include "opd_extended.h"
#include "oprofiled.h"
#include "op_libiberty.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
Include dependency graph for opd_sfile.c:

Classes

struct  kern_cmdline

Defines

#define HASH_SIZE   2048
#define HASH_BITS   (HASH_SIZE - 1)
#define LRU_AMOUNT   256

Typedefs

typedef int(* sfile_func )(struct sfile *, void *)

Functions

int sfile_equal (struct sfile const *sf, struct sfile const *sf2)
struct sfilesfile_find (struct transient const *trans)
 Find the sfile for the current parameters.
void sfile_dup (struct sfile *to, struct sfile *from)
void sfile_log_sample (struct transient const *trans)
 Log the sample in a previously located sfile.
void sfile_log_sample_count (struct transient const *trans, unsigned long int count)
 Log the event/cycle count in a previously located sfile.
void sfile_clear_kernel (void)
 clear any sfiles that are for the kernel
void sfile_clear_anon (struct anon_mapping *anon)
 clear any sfiles for the given anon mapping
void sfile_sync_files (void)
 sync sample files
void sfile_close_files (void)
 close sample files
int sfile_lru_clear (void)
 clear out a certain amount of LRU entries return non-zero if the lru is already empty
void sfile_get (struct sfile *sf)
 remove a sfile from the lru list, protecting it from sfile_lru_clear()
void sfile_put (struct sfile *sf)
 add this sfile to lru list
void sfile_init (void)
 initialise hashes

Detailed Description

Management of sample files.

Remarks:
Copyright 2002, 2005 OProfile authors
Read the file COPYING
Author:
John Levon
Philippe Elie

Define Documentation

#define HASH_BITS   (HASH_SIZE - 1)
#define HASH_SIZE   2048
#define LRU_AMOUNT   256

Typedef Documentation

typedef int(* sfile_func)(struct sfile *, void *)

Function Documentation

void sfile_clear_anon ( struct anon_mapping anon  ) 

clear any sfiles for the given anon mapping

void sfile_clear_kernel ( void   ) 

clear any sfiles that are for the kernel

void sfile_close_files ( void   ) 

close sample files

void sfile_dup ( struct sfile to,
struct sfile from 
)
int sfile_equal ( struct sfile const *  sf,
struct sfile const *  sf2 
)
struct sfile* sfile_find ( struct transient const *  trans  )  [read]
void sfile_get ( struct sfile sf  ) 

remove a sfile from the lru list, protecting it from sfile_lru_clear()

References sfile::lru.

Referenced by opd_open_sample_file(), and sfile_find().

void sfile_init ( void   ) 

initialise hashes

References HASH_SIZE.

void sfile_log_sample ( struct transient const *  trans  ) 

Log the sample in a previously located sfile.

References sfile_log_sample_count().

void sfile_log_sample_count ( struct transient const *  trans,
unsigned long int  count 
)

Log the event/cycle count in a previously located sfile.

References odb_update_node_with_offset(), OPD_LOST_SAMPLEFILE, opd_stats, TRACING_ON, and vsamples.

Referenced by opd_log_ibs_count(), opd_log_ibs_event(), and sfile_log_sample().

int 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, sfile::lru, and LRU_AMOUNT.

Referenced by opd_open_sample_file().

void sfile_put ( struct sfile sf  ) 

add this sfile to lru list

References sfile::lru.

Referenced by opd_open_sample_file(), and sfile_find().

void sfile_sync_files ( void   ) 

sync sample files


Generated on 29 Jul 2013 for oprofile by  doxygen 1.6.1