00001 /** 00002 * @file libperf_events/operf_stats.h 00003 * Management of operf statistics 00004 * 00005 * @remark Copyright 2012 OProfile authors 00006 * @remark Read the file COPYING 00007 * 00008 * Created on: June 11, 2012 00009 * @author Maynard Johnson 00010 * (C) Copyright IBM Corp. 2012 00011 */ 00012 00013 #include <string> 00014 00015 #ifndef OPERF_STATS_H 00016 #define OPERF_STATS_H 00017 00018 extern unsigned long operf_stats[]; 00019 00020 enum { OPERF_SAMPLES, /**< nr. samples */ 00021 OPERF_KERNEL, /**< nr. kernel samples */ 00022 OPERF_PROCESS, /**< nr. userspace samples */ 00023 OPERF_INVALID_CTX, /**< nr. samples lost due to sample address not in expected range for domain */ 00024 OPERF_LOST_KERNEL, /**< nr. kernel samples lost */ 00025 OPERF_LOST_SAMPLEFILE, /**< nr samples for which sample file can't be opened */ 00026 OPERF_LOST_NO_MAPPING, /**< nr samples lost due to no mapping */ 00027 OPERF_NO_APP_KERNEL_SAMPLE, /**<nr. user ctx kernel samples dropped due to no app context available */ 00028 OPERF_NO_APP_USER_SAMPLE, /**<nr. user samples dropped due to no app context available */ 00029 OPERF_BT_LOST_NO_MAPPING, /**<nr. backtrace samples dropped due to no mapping */ 00030 OPERF_LOST_INVALID_HYPERV_ADDR, /**<nr. hypervisor samples dropped due to address out-of-range */ 00031 OPERF_RECORD_LOST_SAMPLE, /**<nr. samples lost reported by perf_events kernel */ 00032 OPERF_MAX_STATS /**< end of stats */ 00033 }; 00034 #define OPERF_INDEX_OF_FIRST_LOST_STAT 3 00035 00036 /* Warn on lost samples if number of lost samples is greater the this fraction 00037 * of the total samples 00038 */ 00039 #define OPERF_WARN_LOST_SAMPLES_THRESHOLD 0.0001 00040 00041 void operf_print_stats(std::string sampledir, char * starttime, bool throttled); 00042 00043 #endif /* OPERF_STATS_H */
1.6.1