ocount.cpp File Reference

Tool for event counting using the new Linux Performance Events Subsystem. More...

#include "config.h"
#include <iostream>
#include <stdexcept>
#include <fstream>
#include <vector>
#include <set>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <sys/time.h>
#include "op_pe_utils.h"
#include "ocount_counter.h"
#include "op_cpu_type.h"
#include "op_cpufreq.h"
#include "operf_event.h"
#include "cverb.h"
#include "op_libiberty.h"
Include dependency graph for ocount.cpp:

Namespaces

namespace  ocount_options

Typedefs

typedef enum END_CODE end_code_t

Enumerations

enum  END_CODE {
  ALL_OK = 0, APP_ABNORMAL_END = 1, PERF_RECORD_ERROR = 2, PERF_READ_ERROR = 4,
  PERF_BOTH_ERROR = 8, ALL_OK = 0, APP_ABNORMAL_END = 1, PERF_RECORD_ERROR = 2,
  PERF_READ_ERROR = 4, PERF_BOTH_ERROR = 8
}

Functions

void set_signals_for_parent (void)
void run_app (void)
bool start_counting (void)
end_code_t _get_waitpid_status (int waitpid_status, int wait_rc)
end_code_t _wait_for_app (ostream &out)
int main (int argc, char *const argv[])

Variables

char * app_name = NULL
bool use_cpu_minus_one = false
std::vector< operf_event_tevents
op_cpu cpu_type
bool ocount_options::verbose
bool ocount_options::system_wide
vector< pid_t > ocount_options::processes
vector< pid_t > ocount_options::threads
vector< int > ocount_options::cpus
string ocount_options::outfile
bool ocount_options::separate_cpu
bool ocount_options::separate_thread
vector< string > ocount_options::evts
bool ocount_options::csv_output
long ocount_options::display_interval
long ocount_options::num_intervals
struct option long_options []
const char * short_options = "VsC:p:r:e:f:ctbi:huv"

Detailed Description

Tool for event counting using the new Linux Performance Events Subsystem.

Remarks:
Copyright 2013 OProfile authors
Read the file COPYING

Created on: May 21, 2013

Author:
Maynard Johnson (C) Copyright IBM Corp. 2013

Typedef Documentation

typedef enum END_CODE end_code_t

Enumeration Type Documentation

enum END_CODE
Enumerator:
ALL_OK 
APP_ABNORMAL_END 
PERF_RECORD_ERROR 
PERF_READ_ERROR 
PERF_BOTH_ERROR 
ALL_OK 
APP_ABNORMAL_END 
PERF_RECORD_ERROR 
PERF_READ_ERROR 
PERF_BOTH_ERROR 

Function Documentation

end_code_t _get_waitpid_status ( int  waitpid_status,
int  wait_rc 
)

References ALL_OK, APP_ABNORMAL_END, cverb, and vdebug.

Referenced by _wait_for_app().

end_code_t _wait_for_app ( ostream &  out  ) 
int main ( int  argc,
char *const   argv[] 
)
void run_app ( void   ) 

References app_name, cverb, and vdebug.

Referenced by start_counting(), and start_profiling().

void set_signals_for_parent ( void   ) 
bool start_counting ( void   ) 

Variable Documentation

char* app_name = NULL
std::vector<operf_event_t> events
struct option long_options[]
Initial value:
{
 {"verbose", no_argument, NULL, 'V'},
 {"system-wide", no_argument, NULL, 's'},
 {"cpu-list", required_argument, NULL, 'C'},
 {"process-list", required_argument, NULL, 'p'},
 {"thread-list", required_argument, NULL, 'r'},
 {"events", required_argument, NULL, 'e'},
 {"output-file", required_argument, NULL, 'f'},
 {"separate-cpu", no_argument, NULL, 'c'},
 {"separate-thread", no_argument, NULL, 't'},
 {"brief-format", no_argument, NULL, 'b'},
 {"time-interval", required_argument, NULL, 'i'},
 {"help", no_argument, NULL, 'h'},
 {"usage", no_argument, NULL, 'u'},
 {"version", no_argument, NULL, 'v'},
 {NULL, 9, NULL, 0}
}
const char* short_options = "VsC:p:r:e:f:ctbi:huv"
bool use_cpu_minus_one = false

Generated on 29 Jul 2013 for oprofile by  doxygen 1.6.1