ophelp.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "op_version.h"
#include "op_events.h"
#include "op_popt.h"
#include "op_cpufreq.h"
#include "op_hw_config.h"
#include "op_string.h"
#include "op_alloc_counter.h"
#include "op_parse_event.h"
#include "op_libiberty.h"
#include "op_xml_events.h"
Include dependency graph for ophelp.c:

Go to the source code of this file.

Defines

#define _GNU_SOURCE
#define LINE_LEN   99
#define MAX_LINE   256

Functions

static size_t hweight (size_t mask)
 return the Hamming weight (number of set bits)
static void do_arch_specific_event_help (struct op_event *event)
static void word_wrap (int indent, int *column, char *msg)
static void help_for_event (struct op_event *event)
static void check_event (struct parsed_event *pev, struct op_event const *event)
static void resolve_events (void)
static void show_unit_mask (void)
static void show_extra_mask (void)
static void show_default_event (void)
static void get_options (int argc, char const *argv[])
static void cleanup (void)
int main (int argc, char const *argv[])

Variables

static char const ** chosen_events
static int num_chosen_events
struct parsed_eventparsed_events
static op_cpu cpu_type = CPU_NO_GOOD
static char * cpu_string
static int callgraph_depth
static int want_xml
static poptContext optcon
static int show_vers
static int get_cpu_type
static int check_events
static int unit_mask
static int get_default_event
static int extra_mask
static struct poptOption options []

Detailed Description

Print out PMC event information

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

Definition in file ophelp.c.


Define Documentation

#define _GNU_SOURCE

Definition at line 12 of file ophelp.c.

#define LINE_LEN   99

Definition at line 64 of file ophelp.c.

Referenced by word_wrap().

#define MAX_LINE   256

Definition at line 399 of file ophelp.c.

Referenced by main().


Function Documentation

static void check_event ( struct parsed_event pev,
struct op_event const *  event 
) [static]

Definition at line 169 of file ophelp.c.

References callgraph_depth, parsed_event::count, find_event_by_name(), parsed_event::name, op_check_events(), OP_INVALID_UM, op_resolve_unit_mask(), parsed_event::unit_mask, and op_event::val.

Referenced by resolve_events().

Here is the call graph for this function:

Here is the caller graph for this function:

static void cleanup ( void   )  [static]

make valgrind happy

Definition at line 382 of file ophelp.c.

References num_chosen_events, op_free_events(), and optcon.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void do_arch_specific_event_help ( struct op_event event  )  [static]

Definition at line 53 of file ophelp.c.

References CPU_PPC64_CELL, and op_event::val.

Referenced by help_for_event().

Here is the caller graph for this function:

static void get_options ( int  argc,
char const *  argv[] 
) [static]

get_options - process command line

Parameters:
argc program arg count
argv program arg array

Process the arguments, fatally complaining on error.

Definition at line 361 of file ophelp.c.

References chosen_events, num_chosen_events, op_poptGetContext(), optcon, options, show_vers, and show_version().

Referenced by main(), and run_pp_tool().

Here is the call graph for this function:

Here is the caller graph for this function:

static void help_for_event ( struct op_event event  )  [static]

help_for_event - output event name and description

Parameters:
i event number

output an help string for the event

Definition at line 89 of file ophelp.c.

References buf, op_event::counter_mask, op_unit_mask::default_mask, op_unit_mask::op_described_um::desc, op_event::desc, do_arch_specific_event_help(), op_event::ext, op_unit_mask::op_described_um::extra, EXTRA_CMASK_MASK, EXTRA_CMASK_SHIFT, EXTRA_EDGE, EXTRA_INV, hweight(), op_event::min_count, op_unit_mask::name, op_event::name, op_get_nr_counters(), op_unit_mask::um, op_event::unit, op_unit_mask::op_described_um::value, and word_wrap().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t hweight ( size_t  mask  )  [static]

return the Hamming weight (number of set bits)

Definition at line 41 of file ophelp.c.

References parsed_event::count.

Referenced by help_for_event().

Here is the caller graph for this function:

int main ( int  argc,
char const *  argv[] 
)

Definition at line 400 of file ophelp.c.

References check_events, chosen_events, cleanup(), close_xml_events(), CPU_ARCH_PERFMON, CPU_ARM_MPCORE, CPU_ARM_SCORPION, CPU_ARM_SCORPIONMP, CPU_ARM_V6, CPU_ARM_V7, CPU_ARM_V7_CA15, CPU_ARM_V7_CA5, CPU_ARM_V7_CA7, CPU_ARM_V7_CA9, CPU_ARM_XSCALE1, CPU_ARM_XSCALE2, CPU_ATHLON, CPU_ATOM, CPU_AVR32, CPU_AXP_EV4, CPU_AXP_EV5, CPU_AXP_EV6, CPU_AXP_EV67, CPU_AXP_PCA56, CPU_CORE, CPU_CORE_2, CPU_CORE_I7, CPU_FAMILY10, CPU_FAMILY11H, CPU_FAMILY12H, CPU_FAMILY14H, CPU_FAMILY15H, CPU_HAMMER, CPU_IA64, CPU_IA64_1, CPU_IA64_2, CPU_IVYBRIDGE, CPU_MIPS_1004K, CPU_MIPS_20K, CPU_MIPS_24K, CPU_MIPS_25K, CPU_MIPS_34K, CPU_MIPS_5K, CPU_MIPS_74K, CPU_MIPS_LOONGSON2, CPU_MIPS_R10000, CPU_MIPS_R12000, CPU_MIPS_RM7000, CPU_MIPS_RM9000, CPU_MIPS_SB1, CPU_MIPS_VR5432, CPU_MIPS_VR5500, CPU_NEHALEM, CPU_NO_GOOD, CPU_P4, CPU_P4_HT2, CPU_P6_MOBILE, CPU_PII, CPU_PIII, CPU_PPC64_970, CPU_PPC64_970MP, CPU_PPC64_CELL, CPU_PPC64_IBM_COMPAT_V1, CPU_PPC64_PA6T, CPU_PPC64_POWER4, CPU_PPC64_POWER5, CPU_PPC64_POWER5p, CPU_PPC64_POWER5pp, CPU_PPC64_POWER6, CPU_PPC64_POWER7, CPU_PPC_7450, CPU_PPC_E300, CPU_PPC_E500, CPU_PPC_E500_2, CPU_PPRO, CPU_RTC, CPU_S390_Z10, CPU_S390_Z196, CPU_SANDYBRIDGE, cpu_string, CPU_TILE_TILE64, CPU_TILE_TILEGX, CPU_TILE_TILEPRO, CPU_TIMER_INT, CPU_WESTMERE, op_event::event_next, events, extra_mask, find_mapping_for_event(), get_cpu_type, get_default_event, get_options(), help_for_event(), list_entry, list_for_each, MAX_CPU_TYPE, MAX_LINE, num_chosen_events, op_events(), op_get_cpu_number(), op_get_cpu_type(), op_get_cpu_type_str(), open_xml_events(), resolve_events(), show_default_event(), show_extra_mask(), show_unit_mask(), unit_mask, want_xml, and xml_help_for_event().

Here is the call graph for this function:

static void resolve_events ( void   )  [static]
static void show_default_event ( void   )  [static]

Definition at line 311 of file ophelp.c.

References op_default_event_descr::count, op_default_event_descr::name, op_default_event(), and op_default_event_descr::um.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void show_extra_mask ( void   )  [static]

Definition at line 296 of file ophelp.c.

References chosen_events, parsed_event::count, num_chosen_events, op_resolve_unit_mask(), and parse_events().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void show_unit_mask ( void   )  [static]

Definition at line 279 of file ophelp.c.

References chosen_events, parsed_event::count, num_chosen_events, op_resolve_unit_mask(), parse_events(), unit_mask, and parsed_event::unit_mask_name.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void word_wrap ( int  indent,
int *  column,
char *  msg 
) [static]

Definition at line 66 of file ophelp.c.

References LINE_LEN.

Referenced by help_for_event().

Here is the caller graph for this function:


Variable Documentation

int callgraph_depth [static]

Definition at line 34 of file ophelp.c.

Referenced by check_event().

int check_events [static]

Definition at line 326 of file ophelp.c.

Referenced by main().

char const** chosen_events [static]

Definition at line 29 of file ophelp.c.

Referenced by get_options(), main(), resolve_events(), show_extra_mask(), and show_unit_mask().

char* cpu_string [static]

Definition at line 33 of file ophelp.c.

Referenced by main().

op_cpu cpu_type = CPU_NO_GOOD [static]

Definition at line 32 of file ophelp.c.

int extra_mask [static]

Definition at line 329 of file ophelp.c.

Referenced by main().

int get_cpu_type [static]

Definition at line 325 of file ophelp.c.

Referenced by main().

int get_default_event [static]

Definition at line 328 of file ophelp.c.

Referenced by main().

int num_chosen_events [static]

Definition at line 30 of file ophelp.c.

Referenced by cleanup(), get_options(), main(), resolve_events(), show_extra_mask(), and show_unit_mask().

poptContext optcon [static]

Definition at line 37 of file ophelp.c.

Referenced by cleanup(), get_options(), op_poptGetContext(), and opd_options().

struct poptOption options[] [static]
Initial value:
 {
    { "cpu-type", 'c', POPT_ARG_STRING, &cpu_string, 0,
      "use the given CPU type", "cpu type", },
    { "check-events", 'e', POPT_ARG_NONE, &check_events, 0,
      "check the given event descriptions for validity", NULL, },
    { "unit-mask", 'u', POPT_ARG_NONE, &unit_mask, 0,
      "default unit mask for the given event", NULL, },
    { "get-cpu-type", 'r', POPT_ARG_NONE, &get_cpu_type, 0,
      "show the auto-detected CPU type", NULL, },
    { "get-default-event", 'd', POPT_ARG_NONE, &get_default_event, 0,
      "get the default event", NULL, },
    { "callgraph", '\0', POPT_ARG_INT, &callgraph_depth, 0,
      "use this callgraph depth", "callgraph depth", },
    { "version", 'v', POPT_ARG_NONE, &show_vers, 0,
       "show version", NULL, },
    { "xml", 'X', POPT_ARG_NONE, &want_xml, 0,
       "list events as XML", NULL, },
    { "extra-mask", 'E', POPT_ARG_NONE, &extra_mask, 0,
      "print extra mask for event", NULL, },
    POPT_AUTOHELP
    { NULL, 0, 0, NULL, 0, NULL, NULL, },
}

Definition at line 331 of file ophelp.c.

Referenced by get_options().

Definition at line 31 of file ophelp.c.

int show_vers [static]

Definition at line 324 of file ophelp.c.

Referenced by get_options().

int unit_mask [static]

Definition at line 327 of file ophelp.c.

Referenced by do_test(), load_events(), main(), and show_unit_mask().

int want_xml [static]

Definition at line 35 of file ophelp.c.


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1