Re: [PATCH] Remove opcontrol, as well as GUI and processor models dependent on it
Carl Love <[email protected]>
| Newsgroups | gmane.linux.oprofile |
|---|---|
| Message-ID | <[email protected]> |
Maynard: Just wanted to formally reply to the community that I did review and test the patch on PPC64. acked-by: [email protected] Carl Love On Tue, 2014-08-05 at 15:26 -0500, Maynard Johnson wrote: > Hello, OProfile community, > To reiterate, opcontrol is being removed in the next oprofile release -- 1.0. > The patch below removes opcontrol and everything related to it or dependent on > it, from the daemon directory to the oprof_start GUI tool. My colleague, > Carl Love, has reviewed/tested the patch, but it would be ideal to have some more > eyes looking at it. The changes regarding things dependent on opcontrol are not > quite complete. Possible additional changes are: > > Description Issue Owner > -------------------------------------------------------------------- > Remove s390 support operf/ocount broken *Andreas Arnez* > Remove Alpha support Alpha not supported *Michael Cree* > in op_get_cpu_type > for operf/ocount > Remove AMD IBS events IBS events not supported *Suravee* > in op_pe_utils:_get_event_code > for operf/ocount > ----------------------------------------------------------------- > > Due to my limited availability in the latter half of August and early September, > I would really like to get a release candidate put out by some time next > week. So please help out where you can. Thanks! > > <+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++> > > Remove opcontrol and the GUI and processor models dependent on it > > The opcontrol-based profiler has been deprecated since 0.9.8, and it is now > being removed for release 1.0. At the same time, we must remove the GUI > component (i.e., oprof_start tool) which currently only supports opcontrol. > And with the removal of the GUI, oprofile no longer has the need for QT, so > so relevant changes were made in configuration.ac and the m4/qt.m4 file removed. > > Note: There has been some discussion off and on over the past year or so > about modernizing oprof_start and adding operf support to it, but there has > not been enough interest in the tool to get this done. > > Certain older architectures and processor types have been supported only by > opcontrol, so this patch removes all files and references relating to them. > The affected architectures/processor types are: > > Arch avr32 > Arch ia64 > Processor model IBM Cell > Processor model P.A. Semi PA6T > RTC > > OProfile users still running on any of these affected systems should not upgrade to > OProfile release 1.0. > > Finally, various code and doc touch-ups were done to remove references to opcontrol > and the various parts of the opcontrol-based profiler. > > Signed-off-by: Maynard Johnson <[email protected]> > --- > Makefile.am | 2 - > README | 25 +- > configure.ac | 80 - > daemon/.gitignore | 4 - > daemon/Makefile.am | 57 - > daemon/init.c | 374 ----- > daemon/liblegacy/.gitignore | 4 - > daemon/opd_anon.c | 228 --- > daemon/opd_anon.h | 54 - > daemon/opd_cookie.c | 210 --- > daemon/opd_cookie.h | 39 - > daemon/opd_events.c | 189 --- > daemon/opd_events.h | 47 - > daemon/opd_extended.c | 195 --- > daemon/opd_extended.h | 94 -- > daemon/opd_ibs.c | 837 ----------- > daemon/opd_ibs.h | 133 -- > daemon/opd_ibs_macro.h | 397 ----- > daemon/opd_ibs_trans.c | 634 -------- > daemon/opd_ibs_trans.h | 35 - > daemon/opd_interface.h | 48 - > daemon/opd_kernel.c | 229 --- > daemon/opd_kernel.h | 43 - > daemon/opd_mangling.c | 213 --- > daemon/opd_mangling.h | 33 - > daemon/opd_perfmon.c | 522 ------- > daemon/opd_perfmon.h | 106 -- > daemon/opd_pipe.c | 99 -- > daemon/opd_pipe.h | 45 - > daemon/opd_printf.h | 37 - > daemon/opd_sfile.c | 751 ---------- > daemon/opd_sfile.h | 119 -- > daemon/opd_spu.c | 176 --- > daemon/opd_stats.c | 92 -- > daemon/opd_stats.h | 32 - > daemon/opd_trans.c | 354 ----- > daemon/opd_trans.h | 86 -- > daemon/oprofiled.c | 532 ------- > daemon/oprofiled.h | 69 - > doc/Makefile.am | 2 - > doc/opannotate.1.in | 15 +- > doc/oparchive.1.in | 17 +- > doc/opcontrol.1.in | 198 --- > doc/operf.1.in | 18 +- > doc/opgprof.1.in | 13 +- > doc/ophelp.1.in | 3 - > doc/opimport.1.in | 4 +- > doc/opreport.1.in | 15 +- > doc/oprof_start.1.in | 43 - > doc/oprofile.1.in | 22 - > doc/oprofile.xml | 1177 +++------------ > events/Makefile.am | 8 - > events/avr32/events | 27 - > events/avr32/unit_masks | 4 - > events/ia64/ia64/events | 3 - > events/ia64/ia64/unit_masks | 4 - > events/ia64/itanium/events | 5 - > events/ia64/itanium/unit_masks | 4 - > events/ia64/itanium2/events | 267 ---- > events/ia64/itanium2/unit_masks | 465 ------ > events/ppc64/cell-be/events | 517 ------- > events/ppc64/cell-be/unit_masks | 137 -- > events/ppc64/ibm-compat-v1/event_mappings | 82 -- > events/ppc64/ibm-compat-v1/events | 91 -- > events/ppc64/ibm-compat-v1/unit_masks | 9 - > events/ppc64/pa6t/event_mappings | 48 - > events/ppc64/pa6t/events | 52 - > events/ppc64/pa6t/unit_masks | 4 - > events/rtc/events | 3 - > events/rtc/unit_masks | 4 - > gui/.gitignore | 7 - > gui/Makefile.am | 43 - > gui/oprof_start.cpp | 1094 -------------- > gui/oprof_start.h | 170 --- > gui/oprof_start_config.cpp | 104 -- > gui/oprof_start_config.h | 56 - > gui/oprof_start_main.cpp | 37 - > gui/oprof_start_util.cpp | 324 ----- > gui/oprof_start_util.h | 39 - > gui/ui/.gitignore | 6 - > gui/ui/Makefile.am | 24 - > gui/ui/oprof_start.base.ui | 1190 --------------- > libop/Makefile.am | 2 - > libop/op_alloc_counter.c | 61 +- > libop/op_config.c | 11 - > libop/op_config.h | 31 - > libop/op_cpu_type.c | 69 +- > libop/op_cpu_type.h | 35 +- > libop/op_events.c | 82 +- > libop/op_events.h | 10 - > libop/op_get_interface.c | 29 - > libop/op_interface.h | 87 -- > libop/op_parse_event.c | 11 - > libop/op_xml_events.c | 15 - > libop/tests/cpu_type_tests.c | 4 - > libpp/op_header.cpp | 26 +- > libpp/profile_spec.cpp | 5 +- > m4/Makefile.am | 1 - > m4/cellspubfdsupport.m4 | 52 - > m4/qt.m4 | 225 --- > opjitconv/create_bfd.c | 1 - > opjitconv/jitsymbol.c | 1 - > opjitconv/opjitconv.c | 7 +- > opjitconv/opjitconv.h | 8 + > opjitconv/parse_dump.c | 1 - > pe_counting/ocount.cpp | 12 +- > pe_profiling/operf.cpp | 10 +- > pp/common_option.cpp | 2 +- > pp/oparchive_options.cpp | 4 +- > utils/Makefile.am | 1 - > utils/opcontrol | 2252 ----------------------------- > utils/ophelp.c | 80 +- > 112 files changed, 344 insertions(+), 16370 deletions(-) > delete mode 100644 daemon/.gitignore > delete mode 100644 daemon/Makefile.am > delete mode 100644 daemon/init.c > delete mode 100644 daemon/liblegacy/.gitignore > delete mode 100644 daemon/opd_anon.c > delete mode 100644 daemon/opd_anon.h > delete mode 100644 daemon/opd_cookie.c > delete mode 100644 daemon/opd_cookie.h > delete mode 100644 daemon/opd_events.c > delete mode 100644 daemon/opd_events.h > delete mode 100644 daemon/opd_extended.c > delete mode 100644 daemon/opd_extended.h > delete mode 100644 daemon/opd_ibs.c > delete mode 100644 daemon/opd_ibs.h > delete mode 100644 daemon/opd_ibs_macro.h > delete mode 100644 daemon/opd_ibs_trans.c > delete mode 100644 daemon/opd_ibs_trans.h > delete mode 100644 daemon/opd_interface.h > delete mode 100644 daemon/opd_kernel.c > delete mode 100644 daemon/opd_kernel.h > delete mode 100644 daemon/opd_mangling.c > delete mode 100644 daemon/opd_mangling.h > delete mode 100644 daemon/opd_perfmon.c > delete mode 100644 daemon/opd_perfmon.h > delete mode 100644 daemon/opd_pipe.c > delete mode 100644 daemon/opd_pipe.h > delete mode 100644 daemon/opd_printf.h > delete mode 100644 daemon/opd_sfile.c > delete mode 100644 daemon/opd_sfile.h > delete mode 100644 daemon/opd_spu.c > delete mode 100644 daemon/opd_stats.c > delete mode 100644 daemon/opd_stats.h > delete mode 100644 daemon/opd_trans.c > delete mode 100644 daemon/opd_trans.h > delete mode 100644 daemon/oprofiled.c > delete mode 100644 daemon/oprofiled.h > delete mode 100644 doc/opcontrol.1.in > delete mode 100644 doc/oprof_start.1.in > delete mode 100644 events/avr32/events > delete mode 100644 events/avr32/unit_masks > delete mode 100644 events/ia64/ia64/events > delete mode 100644 events/ia64/ia64/unit_masks > delete mode 100644 events/ia64/itanium/events > delete mode 100644 events/ia64/itanium/unit_masks > delete mode 100644 events/ia64/itanium2/events > delete mode 100644 events/ia64/itanium2/unit_masks > delete mode 100644 events/ppc64/cell-be/events > delete mode 100644 events/ppc64/cell-be/unit_masks > delete mode 100644 events/ppc64/ibm-compat-v1/event_mappings > delete mode 100644 events/ppc64/ibm-compat-v1/events > delete mode 100644 events/ppc64/ibm-compat-v1/unit_masks > delete mode 100644 events/ppc64/pa6t/event_mappings > delete mode 100644 events/ppc64/pa6t/events > delete mode 100644 events/ppc64/pa6t/unit_masks > delete mode 100644 events/rtc/events > delete mode 100644 events/rtc/unit_masks > delete mode 100644 gui/.gitignore > delete mode 100644 gui/Makefile.am > delete mode 100644 gui/oprof_start.cpp > delete mode 100644 gui/oprof_start.h > delete mode 100644 gui/oprof_start_config.cpp > delete mode 100644 gui/oprof_start_config.h > delete mode 100644 gui/oprof_start_main.cpp > delete mode 100644 gui/oprof_start_util.cpp > delete mode 100644 gui/oprof_start_util.h > delete mode 100644 gui/ui/.gitignore > delete mode 100644 gui/ui/Makefile.am > delete mode 100644 gui/ui/oprof_start.base.ui > delete mode 100644 libop/op_get_interface.c > delete mode 100644 libop/op_interface.h > delete mode 100644 m4/cellspubfdsupport.m4 > delete mode 100644 m4/qt.m4 > delete mode 100755 utils/opcontrol > > diff --git a/Makefile.am b/Makefile.am > index 2fe8d2f..e52d3f0 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -10,7 +10,6 @@ SUBDIRS = \ > libutil++ \ > libopt++ \ > libabi \ > - daemon \ > utils \ > libregex \ > libpp \ > @@ -18,7 +17,6 @@ SUBDIRS = \ > pp \ > events \ > doc \ > - gui \ > libpe_utils \ > libperf_events \ > pe_profiling \ > diff --git a/README b/README > index 307c8d9..d4a8651 100644 > --- a/README > +++ b/README > @@ -1,17 +1,21 @@ > -This is an alpha release version of oprofile, a transparent > -low-overhead system-wide profiler. > +OProfile provides a low-overhead profiler (operf) capable of both > +single-application profiling and system-wide profiling. There is > +also a simple event counting tool (ocount). > > You can find some documentation in the doc/ directory. > > Please visit the oprofile website at : http://oprofile.sf.net/ > > -oprofile was written by John Levon <[email protected]> > -and Philippe Elie <[email protected]>. > - > -Maynard Johnson <[email protected]> is the current maintainer. > +oprofile was originally written by John Levon <[email protected]> > +and Philippe Elie <[email protected]>. The operf and ocount > +tools were developed by Maynard Johnson <[email protected]>, who > +is the current maintainer. > > Dave Jones <[email protected]> provided bug fixes and support for > -the AMD Athlon, and AMD Hammer families of CPUs. > +the AMD Athlon, and AMD Hammer families of CPUs. [email protected] > +<[email protected]> contributed various AMD-related patches, > +including Instruction-Based-Sampling support (available only in > +pre-1.0 releases). > > Bob Montgomery <[email protected]> provided bug fixes, the initial RTC > driver and the initial ia64 driver. > @@ -19,18 +23,21 @@ driver and the initial ia64 driver. > Will Cohen <[email protected]> integrated the ia64 driver into the > oprofile release, and contributed bug fixes and several cleanups. > > +Will Deacon <[email protected]> has contributed patches as well as > +his time to support the ARM architecture. > + > Graydon Hoare <[email protected]> provided P4 port, bug fixes and cleanups. > > Ralf Baechle <[email protected]> provided the MIPS port. > > -Other contributors are listed in the ChangeLog. > +Other contributors can be seen via 'git log'. > > Building > -------- > > Please read the installation instructions in doc/oprofile.html or > http://oprofile.sourceforge.net/doc/install.html. > -Only 2.6 kernels are supported. > +Only 2.6 kernels (or later) are supported. > > Quick start : > > diff --git a/configure.ac b/configure.ac > index d80ec1b..cf7d897 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -240,8 +240,6 @@ LDFLAGS="$LDFLAGS_SAVE" > AC_SUBST(OP_CPPFLAGS) > AC_SUBST(OP_LDFLAGS) > > -AX_CELL_SPU > - > # C++ tests > > AC_LANG_CPLUSPLUS > @@ -262,68 +260,6 @@ AX_TYPEDEFED_NAME(ptrdiff_t, "int" "long", PTRDIFF_T_TYPE) > AC_SUBST(PTRDIFF_T_TYPE) > > AC_PATH_XTRA > -ORIG_X_SAVE_LIBS="$LIBS" > -LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" > -X_LIBS="$LIBS" > -AC_SUBST(X_LIBS) > - > -AC_ARG_ENABLE(gui,[ --enable-gui compile with gui component (qt3|qt4|yes|no), > - if not given or set to yes, gui defaults to qt3],, enable_gui=qt3) > - > -if test "x$enable_gui" = "xqt3" || test "x$enable_gui" = "xyes"; then > - QT_VERSION=3 > - QT_DO_IT_ALL > - if test -n "$QT_LIB"; then > - QT_LIBS="$QT_LIB $QT_LDFLAGS" > - fi > - QT_CFLAGS="$QT_INCLUDES" > -fi > - > -if test "x$enable_gui" = "xqt4"; then > - QT_VERSION=4 > - PKG_CHECK_MODULES(QT, Qt3Support QtGui QtCore ,,[ > - echo "You requested QT4 but its build files are not available. Exiting now." > - exit > - ]) > - MOC=$(pkg-config --variable=moc_location QtCore) > - UIC=$(dirname $(pkg-config --variable=uic_location QtCore))/uic3 > - QT_VERSION=$(pkg-config --modversion QtCore) > - > -dnl following are some sanity tests and workarounds for buggy QtCore.pc files > - if test "x$MOC" = "x"; then > - echo "WARNING: Your QtCore.pc file is buggy, it doesn't provide the variable 'moc_location'" > - echo "WARNING: I will try to find it in your PATH ..." > - AC_CHECK_PROG(MOC, moc, moc) > - if test "x$MOC" = "x"; then > - echo "WARNING: You can fix this by adding the location of moc to your path." > - echo "WARNING: Exiting now." > - exit > - fi > - fi > - > - if test "x$UIC" = "x3"; then > - echo "WARNING: Your QtCore.pc file is buggy, it doesn't provide the variable 'uic_location'" > - echo "WARNING: I will try to find it in your PATH ..." > - AC_CHECK_PROG(UIChelp, uic3, uic3) > - if test "x$UIChelp" = "x"; then > - echo "WARNING: You can fix this by adding the location of uic3 to your path." > - echo "WARNING: Exiting now." > - exit > - else > - UIC="$UIChelp" > - fi > - fi > - > - flags_has_qt3support=$(echo $QT_CFLAGS | grep QT3_SUPPORT) > - if test "x$flags_has_qt3support" = "x" ; then > - echo "WARNING: Your Qt3Support package is buggy; it dosn't include the 'QT3_SUPPORT' flag" > - echo "WARNING: adding it manually" > - QT_CFLAGS="$QT_CFLAGS -DQT3_SUPPORT" > - fi > -fi > -AM_CONDITIONAL(have_qt, test -n "$QT_LIBS") > - > -LIBS="$ORIG_X_SAVE_LIBS" > > dnl enable pch for c++ > AC_ARG_ENABLE(pch, > @@ -439,16 +375,13 @@ AC_OUTPUT(Makefile \ > libregex/tests/Makefile \ > libregex/stl.pat \ > libregex/tests/mangled-name \ > - daemon/Makefile \ > events/Makefile \ > utils/Makefile \ > doc/Makefile \ > doc/xsl/catalog-1.xml \ > doc/oprofile.1 \ > - doc/opcontrol.1 \ > doc/ophelp.1 \ > doc/op-check-perfevents.1 \ > - doc/oprof_start.1 \ > doc/opreport.1 \ > doc/opannotate.1 \ > doc/opgprof.1 \ > @@ -460,24 +393,12 @@ AC_OUTPUT(Makefile \ > libpp/Makefile \ > opjitconv/Makefile \ > pp/Makefile \ > - gui/Makefile \ > - gui/ui/Makefile \ > agents/Makefile \ > agents/jvmti/Makefile \ > agents/jvmpi/Makefile) > > AX_COPY_IF_CHANGE(doc/xsl/catalog-1.xml, doc/xsl/catalog.xml) > > -if test "x$enable_gui" = "xno" ; then > - echo "No GUI will be built as it was explicitly disabled." > -else > - if test -z "$QT_LIBS"; then > - echo "Warning: QT version $QT_VERSION was requested but not found. No GUI will be built." > - else > - echo "Building GUI with QT $QT_VERSION" > - fi > -fi > - > if ! test "x$enable_account_check" = "xyes"; then > : > elif test "`getent passwd oprofile 2>/dev/null`" == "" || \ > @@ -519,5 +440,4 @@ if test "$KERNELDIR" != "" && test "$kernel_has_perf_events_support" != "yes"; t > echo "Then pass <kernel-hdrs-install-dir> to oprofile's '--with-kernel' configure option." > fi > echo "" > - echo "If you run 'make' now, only the legacy ocontrol-based profiler will be built." > fi > diff --git a/daemon/.gitignore b/daemon/.gitignore > deleted file mode 100644 > index 40c0701..0000000 > --- a/daemon/.gitignore > +++ /dev/null > @@ -1,4 +0,0 @@ > -.deps > -Makefile > -Makefile.in > -oprofiled > diff --git a/daemon/Makefile.am b/daemon/Makefile.am > deleted file mode 100644 > index f30f30f..0000000 > --- a/daemon/Makefile.am > +++ /dev/null > @@ -1,57 +0,0 @@ > -oprofiled_SOURCES = \ > - init.c \ > - oprofiled.c \ > - oprofiled.h \ > - opd_stats.c \ > - opd_pipe.c \ > - opd_pipe.h \ > - opd_sfile.c \ > - opd_sfile.h \ > - opd_kernel.c \ > - opd_kernel.h \ > - opd_trans.c \ > - opd_trans.h \ > - opd_printf.h \ > - opd_stats.h \ > - opd_cookie.c \ > - opd_cookie.h \ > - opd_events.c \ > - opd_events.h \ > - opd_interface.h \ > - opd_mangling.c \ > - opd_mangling.h \ > - opd_perfmon.h \ > - opd_perfmon.c \ > - opd_anon.h \ > - opd_anon.c \ > - opd_spu.c \ > - opd_extended.h \ > - opd_extended.c \ > - opd_ibs.h \ > - opd_ibs.c \ > - opd_ibs_macro.h \ > - opd_ibs_trans.h \ > - opd_ibs_trans.c > - > -LIBS=@POPT_LIBS@ @LIBERTY_LIBS@ > - > -AM_CPPFLAGS = \ > - -I ${top_srcdir}/libabi \ > - -I ${top_srcdir}/libutil \ > - -I ${top_srcdir}/libop \ > - -I ${top_srcdir}/libdb \ > - @OP_CPPFLAGS@ > - > -# -fno-omit-frame-pointer needed for daemon build: see ChangeLog-2004 02-23 > -AM_CFLAGS = @OP_CFLAGS@ -fno-omit-frame-pointer > -AM_LDFLAGS = @OP_LDFLAGS@ > - > -bin_PROGRAMS = oprofiled > - > -oprofiled_LDADD = \ > - ../libabi/libabi.a \ > - ../libdb/libodb.a \ > - ../libop/libop.a \ > - ../libutil/libutil.a > - > -oprofiled_LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ > diff --git a/daemon/init.c b/daemon/init.c > deleted file mode 100644 > index 1fed812..0000000 > --- a/daemon/init.c > +++ /dev/null > @@ -1,374 +0,0 @@ > -/** > - * @file daemon/init.c > - * Daemon set up and main loop for 2.6 > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - * @Modifications Daniel Hansel > - * Modified by Aravind Menon for Xen > - * These modifications are: > - * Copyright (C) 2005 Hewlett-Packard Co. > - */ > - > -#include "config.h" > - > -#include "oprofiled.h" > -#include "opd_stats.h" > -#include "opd_sfile.h" > -#include "opd_pipe.h" > -#include "opd_kernel.h" > -#include "opd_trans.h" > -#include "opd_anon.h" > -#include "opd_perfmon.h" > -#include "opd_printf.h" > -#include "opd_extended.h" > - > -#include "op_version.h" > -#include "op_config.h" > -#include "op_deviceio.h" > -#include "op_get_time.h" > -#include "op_libiberty.h" > -#include "op_fileio.h" > - > -#include <fcntl.h> > -#include <stdio.h> > -#include <errno.h> > -#include <limits.h> > -#include <stdlib.h> > -#include <sys/time.h> > -#include <wait.h> > -#include <string.h> > - > -size_t kernel_pointer_size; > - > -static fd_t devfd; > -static char * sbuf; > -static size_t s_buf_bytesize; > -extern char * session_dir; > -static char start_time_str[32]; > -static int jit_conversion_running; > - > -static void opd_sighup(void); > -static void opd_alarm(void); > -static void opd_sigterm(void); > -static void opd_sigchild(void); > -static void opd_do_jitdumps(void); > - > -/** > - * opd_open_files - open necessary files > - * > - * Open the device files and the log file, > - * and mmap() the hash map. > - */ > -static void opd_open_files(void) > -{ > - devfd = op_open_device("/dev/oprofile/buffer"); > - if (devfd == -1) { > - if (errno == EINVAL) > - fprintf(stderr, "Failed to open device. Possibly you have passed incorrect\n" > - "parameters. Check /var/log/messages."); > - else > - perror("Failed to open profile device"); > - exit(EXIT_FAILURE); > - } > - > - /* give output before re-opening stdout as the logfile */ > - printf("Using log file %s\n", op_log_file); > - > - /* set up logfile */ > - close(0); > - close(1); > - > - if (open("/dev/null", O_RDONLY) == -1) { > - perror("oprofiled: couldn't re-open stdin as /dev/null: "); > - exit(EXIT_FAILURE); > - } > - > - opd_open_logfile(); > - opd_create_pipe(); > - > - printf("oprofiled started %s", op_get_time()); > - printf("kernel pointer size: %lu\n", > - (unsigned long)kernel_pointer_size); > - fflush(stdout); > -} > - > - > -/** Done writing out the samples, indicate with complete_dump file */ > -static void complete_dump(void) > -{ > - FILE * status_file; > - > -retry: > - status_file = fopen(op_dump_status, "w"); > - > - if (!status_file && errno == EMFILE) { > - if (sfile_lru_clear()) { > - printf("LRU cleared but file open fails for %s.\n", > - op_dump_status); > - abort(); > - } > - goto retry; > - } > - > - if (!status_file) { > - perror("warning: couldn't set complete_dump: "); > - return; > - } > - > - fprintf(status_file, "1\n"); > - fclose(status_file); > -} > - > - > -/** > - * opd_do_samples - process a sample buffer > - * @param opd_buf buffer to process > - * > - * Process a buffer of samples. > - * > - * If the sample could be processed correctly, it is written > - * to the relevant sample file. > - */ > -static void opd_do_samples(char const * opd_buf, ssize_t count) > -{ > - size_t num = count / kernel_pointer_size; > - > - opd_stats[OPD_DUMP_COUNT]++; > - > - verbprintf(vmisc, "Read buffer of %d entries.\n", (unsigned int)num); > - > - opd_process_samples(opd_buf, num); > - > - complete_dump(); > -} > - > -static void opd_do_jitdumps(void) > -{ > - pid_t childpid; > - int arg_num; > - unsigned long long end_time = 0ULL; > - struct timeval tv; > - char end_time_str[32]; > - char opjitconv_path[PATH_MAX + 1]; > - char * exec_args[8]; > - > - if (jit_conversion_running) > - return; > - jit_conversion_running = 1; > - > - childpid = fork(); > - switch (childpid) { > - case -1: > - perror("Error forking JIT dump process!"); > - break; > - case 0: > - gettimeofday(&tv, NULL); > - end_time = tv.tv_sec; > - sprintf(end_time_str, "%llu", end_time); > - sprintf(opjitconv_path, "%s/%s", OP_BINDIR, "opjitconv"); > - arg_num = 0; > - exec_args[arg_num++] = "opjitconv"; > - if (vmisc) > - exec_args[arg_num++] = "-d"; > - exec_args[arg_num++] = "--delete-jitdumps"; > - exec_args[arg_num++] = "--session-dir"; > - exec_args[arg_num++] = session_dir; > - exec_args[arg_num++] = start_time_str; > - exec_args[arg_num++] = end_time_str; > - exec_args[arg_num] = (char *) NULL; > - execvp(opjitconv_path, exec_args); > - fprintf(stderr, "Failed to exec %s: %s\n", > - exec_args[0], strerror(errno)); > - /* We don't want any cleanup in the child */ > - _exit(EXIT_FAILURE); > - default: > - break; > - } > - > -} > - > -/** > - * opd_do_read - enter processing loop > - * @param buf buffer to read into > - * @param size size of buffer > - * > - * Read some of a buffer from the device and process > - * the contents. > - */ > -static void opd_do_read(char * buf, size_t size) > -{ > - opd_open_pipe(); > - > - while (1) { > - ssize_t count = -1; > - > - /* loop to handle EINTR */ > - while (count < 0) { > - count = op_read_device(devfd, buf, size); > - > - /* we can lose an alarm or a hup but > - * we don't care. > - */ > - if (signal_alarm) { > - signal_alarm = 0; > - opd_alarm(); > - } > - > - if (signal_hup) { > - signal_hup = 0; > - opd_sighup(); > - } > - > - if (signal_term) > - opd_sigterm(); > - > - if (signal_child) > - opd_sigchild(); > - > - if (signal_usr1) { > - signal_usr1 = 0; > - perfmon_start(); > - } > - > - if (signal_usr2) { > - signal_usr2 = 0; > - perfmon_stop(); > - } > - > - if (is_jitconv_requested()) { > - verbprintf(vmisc, "Start opjitconv was triggered\n"); > - opd_do_jitdumps(); > - } > - } > - > - opd_do_samples(buf, count); > - } > - > - opd_close_pipe(); > -} > - > - > -/** opd_alarm - sync files and report stats */ > -static void opd_alarm(void) > -{ > - sfile_sync_files(); > - opd_print_stats(); > - alarm(60 * 10); > -} > - > - > -/** re-open files for logrotate/opcontrol --reset */ > -static void opd_sighup(void) > -{ > - printf("Received SIGHUP.\n"); > - /* We just close them, and re-open them lazily as usual. */ > - sfile_close_files(); > - close(1); > - close(2); > - opd_open_logfile(); > -} > - > - > -static void clean_exit(void) > -{ > - perfmon_exit(); > - unlink(op_lock_file); > -} > - > - > -static void opd_sigterm(void) > -{ > - opd_do_jitdumps(); > - opd_print_stats(); > - printf("oprofiled stopped %s", op_get_time()); > - opd_ext_deinitialize(); > - > - exit(EXIT_FAILURE); > -} > - > -/* SIGCHLD received from JIT dump child process. */ > -static void opd_sigchild(void) > -{ > - int child_status; > - wait(&child_status); > - jit_conversion_running = 0; > - if (WIFEXITED(child_status) && (!WEXITSTATUS(child_status))) { > - verbprintf(vmisc, "JIT dump processing complete.\n"); > - } else { > - printf("JIT dump processing exited abnormally: %d\n", > - WEXITSTATUS(child_status)); > - } > - > -} > - > -static void opd_26_init(void) > -{ > - size_t i; > - size_t opd_buf_size; > - unsigned long long start_time = 0ULL; > - struct timeval tv; > - > - opd_create_vmlinux(vmlinux, kernel_range); > - opd_create_xen(xenimage, xen_range); > - > - opd_buf_size = opd_read_fs_int("/dev/oprofile/", "buffer_size", 1); > - kernel_pointer_size = opd_read_fs_int("/dev/oprofile/", "pointer_size", 1); > - > - s_buf_bytesize = opd_buf_size * kernel_pointer_size; > - > - sbuf = xmalloc(s_buf_bytesize); > - > - opd_reread_module_info(); > - > - for (i = 0; i < OPD_MAX_STATS; i++) > - opd_stats[i] = 0; > - > - perfmon_init(); > - > - cookie_init(); > - sfile_init(); > - anon_init(); > - > - /* must be /after/ perfmon_init() at least */ > - if (atexit(clean_exit)) { > - perfmon_exit(); > - perror("oprofiled: couldn't set exit cleanup: "); > - exit(EXIT_FAILURE); > - } > - > - /* trigger kernel module setup before returning control to opcontrol */ > - opd_open_files(); > - gettimeofday(&tv, NULL); > - start_time = 0ULL; > - start_time = tv.tv_sec; > - sprintf(start_time_str, "%llu", start_time); > - > -} > - > - > -static void opd_26_start(void) > -{ > - /* simple sleep-then-process loop */ > - opd_do_read(sbuf, s_buf_bytesize); > -} > - > - > -static void opd_26_exit(void) > -{ > - opd_print_stats(); > - printf("oprofiled stopped %s", op_get_time()); > - > - free(sbuf); > - free(vmlinux); > - /* FIXME: free kernel images, sfiles etc. */ > -} > - > -struct oprofiled_ops opd_26_ops = { > - .init = opd_26_init, > - .start = opd_26_start, > - .exit = opd_26_exit, > -}; > diff --git a/daemon/liblegacy/.gitignore b/daemon/liblegacy/.gitignore > deleted file mode 100644 > index 9f3a7be..0000000 > --- a/daemon/liblegacy/.gitignore > +++ /dev/null > @@ -1,4 +0,0 @@ > -.deps > -Makefile > -Makefile.in > -liblegacy.a > diff --git a/daemon/opd_anon.c b/daemon/opd_anon.c > deleted file mode 100644 > index 9f35191..0000000 > --- a/daemon/opd_anon.c > +++ /dev/null > @@ -1,228 +0,0 @@ > -/** > - * @file opd_anon.c > - * Anonymous region handling. > - * > - * Our caching of maps has some problems: if we get tgid reuse, > - * and it's the same application, we might end up with wrong > - * maps. The same happens in an unmap-remap case. There's not much > - * we can do about this, we just hope it's not too common... > - * > - * What is relatively common is expanding anon maps, which leaves us > - * with lots of separate sample files. > - * > - * @remark Copyright 2005 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @Modifications Gisle Dankel > - */ > - > -#include "opd_anon.h" > -#include "opd_trans.h" > -#include "opd_sfile.h" > -#include "opd_printf.h" > -#include "op_libiberty.h" > - > -#include <limits.h> > -#include <stdlib.h> > -#include <stdio.h> > -#include <string.h> > - > -#define HASH_SIZE 1024 > -#define HASH_BITS (HASH_SIZE - 1) > - > -/* > - * Note that this value is tempered by the fact that when we miss in the > - * anon cache, we'll tear down all the mappings for that tgid. Thus, LRU > - * of a mapping can potentially clear out a much larger number of > - * mappings. > - */ > -#define LRU_SIZE 8192 > -#define LRU_AMOUNT (LRU_SIZE/8) > - > -static struct list_head hashes[HASH_SIZE]; > -static struct list_head lru; > -static size_t nr_lru; > - > -static void do_lru(struct transient * trans) > -{ > - size_t nr_to_kill = LRU_AMOUNT; > - struct list_head * pos; > - struct list_head * pos2; > - struct anon_mapping * entry; > - > - list_for_each_safe(pos, pos2, &lru) { > - entry = list_entry(pos, struct anon_mapping, lru_list); > - if (trans->anon == entry) > - clear_trans_current(trans); > - if (trans->last_anon == entry) > - clear_trans_last(trans); > - sfile_clear_anon(entry); > - list_del(&entry->list); > - list_del(&entry->lru_list); > - --nr_lru; > - free(entry); > - if (nr_to_kill-- == 0) > - break; > - } > -} > - > - > -static unsigned long hash_anon(pid_t tgid, cookie_t app) > -{ > - return ((app >> DCOOKIE_SHIFT) ^ (tgid >> 2)) & (HASH_SIZE - 1); > -} > - > - > -static void clear_anon_maps(struct transient * trans) > -{ > - unsigned long hash = hash_anon(trans->tgid, trans->app_cookie); > - pid_t tgid = trans->tgid; > - cookie_t app = trans->app_cookie; > - struct list_head * pos; > - struct list_head * pos2; > - struct anon_mapping * entry; > - > - clear_trans_current(trans); > - > - list_for_each_safe(pos, pos2, &hashes[hash]) { > - entry = list_entry(pos, struct anon_mapping, list); > - if (entry->tgid == tgid && entry->app_cookie == app) { > - if (trans->last_anon == entry) > - clear_trans_last(trans); > - sfile_clear_anon(entry); > - list_del(&entry->list); > - list_del(&entry->lru_list); > - --nr_lru; > - free(entry); > - } > - } > - > - if (vmisc) { > - char const * name = verbose_cookie(app); > - printf("Cleared anon maps for tgid %u (%s).\n", tgid, name); > - } > -} > - > - > -static void > -add_anon_mapping(struct transient * trans, vma_t start, vma_t end, char * name) > -{ > - unsigned long hash = hash_anon(trans->tgid, trans->app_cookie); > - struct anon_mapping * m = xmalloc(sizeof(struct anon_mapping)); > - m->tgid = trans->tgid; > - m->app_cookie = trans->app_cookie; > - m->start = start; > - m->end = end; > - strncpy(m->name, name, MAX_IMAGE_NAME_SIZE); > - list_add_tail(&m->list, &hashes[hash]); > - list_add_tail(&m->lru_list, &lru); > - if (++nr_lru == LRU_SIZE) > - do_lru(trans); > - if (vmisc) { > - char const * name = verbose_cookie(m->app_cookie); > - printf("Added anon map 0x%llx-0x%llx for tgid %u (%s).\n", > - start, end, m->tgid, name); > - } > -} > - > - > -/* 42000000-4212f000 r-xp 00000000 16:03 424334 /lib/tls/libc-2.3.2.so */ > -static void get_anon_maps(struct transient * trans) > -{ > - FILE * fp = NULL; > - char buf[PATH_MAX]; > - vma_t start, end; > - int ret; > - > - snprintf(buf, PATH_MAX, "/proc/%d/maps", trans->tgid); > - fp = fopen(buf, "r"); > - if (!fp) > - return; > - > - while (fgets(buf, PATH_MAX, fp) != NULL) { > - char tmp[MAX_IMAGE_NAME_SIZE + 1]; > - char name[MAX_IMAGE_NAME_SIZE + 1]; > - /* Some anon maps have labels like > - * [heap], [stack], [vdso], [vsyscall] ... > - * Keep track of these labels. If a map has no name, call it "anon". > - * Ignore all mappings starting with "/" (file or shared memory object) > - */ > - strcpy(name, "anon"); > - ret = sscanf(buf, "%llx-%llx %20s %20s %20s %20s %20s", > - &start, &end, tmp, tmp, tmp, tmp, name); > - if (ret < 6 || name[0] == '/') > - continue; > - > - add_anon_mapping(trans, start, end, name); > - } > - > - fclose(fp); > -} > - > - > -static int > -anon_match(struct transient const * trans, struct anon_mapping const * anon) > -{ > - if (!anon) > - return 0; > - if (trans->tgid != anon->tgid) > - return 0; > - if (trans->app_cookie != anon->app_cookie) > - return 0; > - if (trans->pc < anon->start) > - return 0; > - return (trans->pc < anon->end); > -} > - > - > -struct anon_mapping * find_anon_mapping(struct transient * trans) > -{ > - unsigned long hash = hash_anon(trans->tgid, trans->app_cookie); > - struct list_head * pos; > - struct anon_mapping * entry; > - int tried = 0; > - > - if (anon_match(trans, trans->anon)) > - return (trans->anon); > - > -retry: > - list_for_each(pos, &hashes[hash]) { > - entry = list_entry(pos, struct anon_mapping, list); > - if (anon_match(trans, entry)) > - goto success; > - } > - > - if (!tried) { > - clear_anon_maps(trans); > - get_anon_maps(trans); > - tried = 1; > - goto retry; > - } > - > - return NULL; > - > -success: > - /* > - * Typically, there's one big mapping that matches. Let's go > - * faster. > - */ > - list_del(&entry->list); > - list_add(&entry->list, &hashes[hash]); > - > - verbprintf(vmisc, "Found range 0x%llx-0x%llx for tgid %u, pc %llx.\n", > - entry->start, entry->end, (unsigned int)entry->tgid, > - trans->pc); > - return entry; > -} > - > - > -void anon_init(void) > -{ > - size_t i; > - > - for (i = 0; i < HASH_SIZE; ++i) > - list_init(&hashes[i]); > - > - list_init(&lru); > -} > diff --git a/daemon/opd_anon.h b/daemon/opd_anon.h > deleted file mode 100644 > index 3f66b55..0000000 > --- a/daemon/opd_anon.h > +++ /dev/null > @@ -1,54 +0,0 @@ > -/** > - * @file opd_anon.h > - * Anonymous region handling. > - * > - * @remark Copyright 2005 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - */ > - > -#ifndef OPD_ANON_H > -#define OPD_ANON_H > - > -#include "op_types.h" > -#include "op_list.h" > - > -#include "opd_cookie.h" > - > -#include <sys/types.h> > - > -struct transient; > - > -/** > - * Shift useful bits into play for VMA hashing. > - */ > -#define VMA_SHIFT 13 > - > -/* Maximum size of the image name considered */ > -#define MAX_IMAGE_NAME_SIZE 20 > - > -struct anon_mapping { > - /** start of the mapping */ > - vma_t start; > - /** end of the mapping */ > - vma_t end; > - /** tgid of the app */ > - pid_t tgid; > - /** cookie of the app */ > - cookie_t app_cookie; > - /** hash list */ > - struct list_head list; > - /** lru list */ > - struct list_head lru_list; > - char name[MAX_IMAGE_NAME_SIZE+1]; > -}; > - > -/** > - * Try to find an anonymous mapping for the given pc/tgid pair. > - */ > -struct anon_mapping * find_anon_mapping(struct transient *); > - > -void anon_init(void); > - > -#endif /* OPD_ANON_H */ > diff --git a/daemon/opd_cookie.c b/daemon/opd_cookie.c > deleted file mode 100644 > index ec3ff2d..0000000 > --- a/daemon/opd_cookie.c > +++ /dev/null > @@ -1,210 +0,0 @@ > -/** > - * @file opd_cookie.c > - * cookie -> name cache > - * > - * @remark Copyright 2002, 2005 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - */ > - > -#include "opd_cookie.h" > -#include "oprofiled.h" > -#include "op_list.h" > -#include "op_libiberty.h" > - > -#include <sys/syscall.h> > -#include <unistd.h> > -#include <limits.h> > -#include <stdio.h> > -#include <stdlib.h> > -#include <errno.h> > - > -#ifndef __NR_lookup_dcookie > -#if defined(__i386__) > -#define __NR_lookup_dcookie 253 > -#elif defined(__x86_64__) > -#define __NR_lookup_dcookie 212 > -#elif defined(__powerpc__) > -#define __NR_lookup_dcookie 235 > -#elif defined(__alpha__) > -#define __NR_lookup_dcookie 406 > -#elif defined(__hppa__) > -#define __NR_lookup_dcookie 223 > -#elif defined(__ia64__) > -#define __NR_lookup_dcookie 1237 > -#elif defined(__sparc__) > -/* untested */ > -#define __NR_lookup_dcookie 208 > -#elif defined(__s390__) || defined (__s390x__) > -#define __NR_lookup_dcookie 110 > -#elif defined(__arm__) > -#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249) > -#elif defined(__mips__) > -#include <sgidefs.h> > -/* O32 */ > -#if _MIPS_SIM == _MIPS_SIM_ABI32 > -#define __NR_lookup_dcookie 4247 > -/* N64 */ > -#elif _MIPS_SIM == _MIPS_SIM_ABI64 > -#define __NR_lookup_dcookie 5206 > -/* N32 */ > -#elif _MIPS_SIM == _MIPS_SIM_NABI32 > -#define __NR_lookup_dcookie 6206 > -#else > -#error Unknown MIPS ABI: Dunno __NR_lookup_dcookie > -#endif > -#else > -#error Please define __NR_lookup_dcookie for your architecture > -#endif > -#endif /* __NR_lookup_dcookie */ > - > -#if (defined(__powerpc__) && !defined(__powerpc64__)) || defined(__hppa__)\ > - || (defined(__s390__) && !defined(__s390x__)) \ > - || (defined(__mips__) && (_MIPS_SIM == _MIPS_SIM_ABI32) \ > - && defined(__MIPSEB__)) \ > - || (defined(__arm__) && defined(__ARM_EABI__) \ > - && defined(__ARMEB__)) > -static inline int lookup_dcookie(cookie_t cookie, char * buf, size_t size) > -{ > - return syscall(__NR_lookup_dcookie, (unsigned long)(cookie >> 32), > - (unsigned long)(cookie & 0xffffffff), buf, size); > -} > -#elif (defined(__mips__) && (_MIPS_SIM == _MIPS_SIM_ABI32)) \ > - || (defined(__arm__) && defined(__ARM_EABI__)) \ > - || (defined(__tile__) && !defined(__LP64__)) > -static inline int lookup_dcookie(cookie_t cookie, char * buf, size_t size) > -{ > - return syscall(__NR_lookup_dcookie, > - (unsigned long)(cookie & 0xffffffff), > - (unsigned long)(cookie >> 32), buf, size); > -} > -#else > -static inline int lookup_dcookie(cookie_t cookie, char * buf, size_t size) > -{ > - return syscall(__NR_lookup_dcookie, cookie, buf, size); > -} > -#endif > - > - > -struct cookie_entry { > - cookie_t value; > - char * name; > - int ignored; > - struct list_head list; > -}; > - > - > -#define HASH_SIZE 512 > -#define HASH_BITS (HASH_SIZE - 1) > - > -static struct list_head hashes[HASH_SIZE]; > - > -static struct cookie_entry * create_cookie(cookie_t cookie) > -{ > - int err; > - struct cookie_entry * entry = xmalloc(sizeof(struct cookie_entry)); > - > - entry->value = cookie; > - entry->name = xmalloc(PATH_MAX + 1); > - > - err = lookup_dcookie(cookie, entry->name, PATH_MAX); > - > - if (err < 0) { > - fprintf(stderr, "Lookup of cookie %llx failed, errno=%d\n", > - cookie, errno); > - free(entry->name); > - entry->name = NULL; > - entry->ignored = 0; > - } else { > - entry->ignored = is_image_ignored(entry->name); > - } > - > - return entry; > -} > - > - > -/* Cookie monster want cookie! */ > -static unsigned long hash_cookie(cookie_t cookie) > -{ > - return (cookie >> DCOOKIE_SHIFT) & (HASH_SIZE - 1); > -} > - > - > -char const * find_cookie(cookie_t cookie) > -{ > - unsigned long hash = hash_cookie(cookie); > - struct list_head * pos; > - struct cookie_entry * entry; > - > - if (cookie == INVALID_COOKIE || cookie == NO_COOKIE) > - return NULL; > - > - list_for_each(pos, &hashes[hash]) { > - entry = list_entry(pos, struct cookie_entry, list); > - if (entry->value == cookie) > - goto out; > - } > - > - /* not sure this can ever happen due to is_cookie_ignored */ > - entry = create_cookie(cookie); > - list_add(&entry->list, &hashes[hash]); > -out: > - return entry->name; > -} > - > - > -int is_cookie_ignored(cookie_t cookie) > -{ > - unsigned long hash = hash_cookie(cookie); > - struct list_head * pos; > - struct cookie_entry * entry; > - > - if (cookie == INVALID_COOKIE || cookie == NO_COOKIE) > - return 1; > - > - list_for_each(pos, &hashes[hash]) { > - entry = list_entry(pos, struct cookie_entry, list); > - if (entry->value == cookie) > - goto out; > - } > - > - entry = create_cookie(cookie); > - list_add(&entry->list, &hashes[hash]); > -out: > - return entry->ignored; > -} > - > - > -char const * verbose_cookie(cookie_t cookie) > -{ > - unsigned long hash = hash_cookie(cookie); > - struct list_head * pos; > - struct cookie_entry * entry; > - > - if (cookie == INVALID_COOKIE) > - return "invalid"; > - > - if (cookie == NO_COOKIE) > - return "anonymous"; > - > - list_for_each(pos, &hashes[hash]) { > - entry = list_entry(pos, struct cookie_entry, list); > - if (entry->value == cookie) { > - if (!entry->name) > - return "failed lookup"; > - return entry->name; > - } > - } > - > - return "not hashed"; > -} > - > - > -void cookie_init(void) > -{ > - size_t i; > - > - for (i = 0; i < HASH_SIZE; ++i) > - list_init(&hashes[i]); > -} > diff --git a/daemon/opd_cookie.h b/daemon/opd_cookie.h > deleted file mode 100644 > index a9f13b1..0000000 > --- a/daemon/opd_cookie.h > +++ /dev/null > @@ -1,39 +0,0 @@ > -/** > - * @file opd_cookie.h > - * cookie -> name cache > - * > - * @remark Copyright 2002, 2005 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - */ > - > -#ifndef OPD_COOKIE_H > -#define OPD_COOKIE_H > - > -typedef unsigned long long cookie_t; > - > -#define INVALID_COOKIE ~0LLU > -#define NO_COOKIE 0LLU > - > -/** > - * Shift value to remove trailing zero on a dcookie value, 7 is sufficient > - * for most architecture > - */ > -#define DCOOKIE_SHIFT 7 > - > -/** > - * Return the name of the given dcookie. May return > - * NULL on failure. > - */ > -char const * find_cookie(cookie_t cookie); > - > -/** return true if this cookie should be ignored */ > -int is_cookie_ignored(cookie_t cookie); > - > -/** give a textual description of the cookie */ > -char const * verbose_cookie(cookie_t cookie); > - > -void cookie_init(void); > - > -#endif /* OPD_COOKIE_H */ > diff --git a/daemon/opd_events.c b/daemon/opd_events.c > deleted file mode 100644 > index 40d6979..0000000 > --- a/daemon/opd_events.c > +++ /dev/null > @@ -1,189 +0,0 @@ > -/** > - * @file daemon/opd_events.c > - * Event details for each counter > - * > - * @remark Copyright 2002, 2003 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#include "config.h" > - > -#include "opd_events.h" > -#include "opd_printf.h" > -#include "opd_extended.h" > -#include "oprofiled.h" > - > -#include "op_string.h" > -#include "op_config.h" > -#include "op_cpufreq.h" > -#include "op_cpu_type.h" > -#include "op_libiberty.h" > -#include "op_hw_config.h" > -#include "op_sample_file.h" > -#include "op_events.h" > - > -#include <stdlib.h> > -#include <stdio.h> > - > -extern op_cpu cpu_type; > - > -struct opd_event opd_events[OP_MAX_COUNTERS]; > - > -static double cpu_speed; > - > -static void malformed_events(void) > -{ > - fprintf(stderr, "oprofiled: malformed events passed " > - "on the command line\n"); > - exit(EXIT_FAILURE); > -} > - > - > -static char * copy_token(char ** c, char delim) > -{ > - char * tmp = *c; > - char * tmp2 = *c; > - char * str; > - > - if (!**c) > - return NULL; > - > - while (*tmp2 && *tmp2 != delim) > - ++tmp2; > - > - if (tmp2 == tmp) > - return NULL; > - > - str = op_xstrndup(tmp, tmp2 - tmp); > - *c = tmp2; > - if (**c) > - ++*c; > - return str; > -} > - > - > -static unsigned long copy_ulong(char ** c, char delim) > -{ > - unsigned long val = 0; > - char * str = copy_token(c, delim); > - if (!str) > - malformed_events(); > - val = strtoul(str, NULL, 0); > - free(str); > - return val; > -} > - > - > -void opd_parse_events(char const * events) > -{ > - char * ev = xstrdup(events); > - char * c; > - size_t cur = 0; > - > - cpu_speed = op_cpu_frequency(); > - > - if (cpu_type == CPU_TIMER_INT) { > - struct opd_event * event = &opd_events[0]; > - event->name = xstrdup("TIMER"); > - event->value = event->counter > - = event->count = event->um = 0; > - event->kernel = 1; > - event->user = 1; > - return; > - } > - > - if (!ev || !strlen(ev)) { > - fprintf(stderr, "oprofiled: no events passed.\n"); > - exit(EXIT_FAILURE); > - } > - > - verbprintf(vmisc, "Events: %s\n", ev); > - > - c = ev; > - > - while (*c && cur < op_nr_counters) { > - struct opd_event * event = &opd_events[cur]; > - > - if (!(event->name = copy_token(&c, ':'))) > - malformed_events(); > - event->value = copy_ulong(&c, ':'); > - event->counter = copy_ulong(&c, ':'); > - event->count = copy_ulong(&c, ':'); > - event->um = copy_ulong(&c, ':'); > - event->kernel = copy_ulong(&c, ':'); > - event->user = copy_ulong(&c, ','); > - ++cur; > - } > - > - if (*c) { > - fprintf(stderr, "oprofiled: too many events passed.\n"); > - exit(EXIT_FAILURE); > - } > - > - free(ev); > -} > - > - > -struct opd_event * find_counter_event(unsigned long counter) > -{ > - size_t i; > - struct opd_event * ret = NULL; > - > - if (counter >= OP_MAX_COUNTERS) { > - if((ret = opd_ext_find_counter_event(counter)) != NULL) > - return ret; > - } > - > - /* > - * The kernel modules will put a 0 as counter number into the > - * samples when timer based sampling is used. So this > - * theoretically might get confused here with the first > - * hardware counter also having number zero. However, TIMER > - * is never allowed to be used together with other events. > - * So it is safe to map this to the timer event without > - * actually doing the lookup. > - */ > - if (op_cpu_has_timer_fs() > - && strcmp(opd_events[0].name, TIMER_EVENT_NAME) == 0 > - && !opd_events[1].name) { > - return &opd_events[0]; > - > - } > - > - for (i = 0; i < op_nr_counters && opd_events[i].name; ++i) { > - if (counter == opd_events[i].counter) > - return &opd_events[i]; > - } > - > - fprintf(stderr, "Unknown event for counter %lu\n", counter); > - abort(); > - return NULL; > -} > - > - > -void fill_header(struct opd_header * header, unsigned long counter, > - vma_t anon_start, vma_t cg_to_anon_start, > - int is_kernel, int cg_to_is_kernel, > - int spu_samples, uint64_t embed_offset, time_t mtime) > -{ > - struct opd_event * event = find_counter_event(counter); > - > - memset(header, '\0', sizeof(struct opd_header)); > - header->version = OPD_VERSION; > - memcpy(header->magic, OPD_MAGIC, sizeof(header->magic)); > - header->cpu_type = cpu_type; > - header->ctr_event = event->value; > - header->ctr_count = event->count; > - header->ctr_um = event->um; > - header->is_kernel = is_kernel; > - header->cg_to_is_kernel = cg_to_is_kernel; > - header->cpu_speed = cpu_speed; > - header->mtime = mtime; > - header->anon_start = anon_start; > - header->spu_profile = spu_samples; > - header->embedded_offset = embed_offset; > - header->cg_to_anon_start = cg_to_anon_start; > -} > diff --git a/daemon/opd_events.h b/daemon/opd_events.h > deleted file mode 100644 > index 1e8b801..0000000 > --- a/daemon/opd_events.h > +++ /dev/null > @@ -1,47 +0,0 @@ > -/** > - * @file daemon/opd_events.h > - * Event details for each counter > - * > - * @remark Copyright 2002, 2003 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#ifndef OPD_EVENTS_H > - > -#include "op_types.h" > - > -#include <stdint.h> > -#include <time.h> > - > -/** event description for setup (perfmon) and mangling */ > -struct opd_event { > - char * name; > - unsigned long value; > - unsigned long counter; > - unsigned long count; > - unsigned long um; > - unsigned long kernel; > - unsigned long user; > -}; > - > -/* needed for opd_perfmon.c */ > -extern struct opd_event opd_events[]; > - > -/** parse the events into the opd_events array */ > -void opd_parse_events(char const * events); > - > -/** Find the event for the given counter */ > -struct opd_event * find_counter_event(unsigned long counter); > - > -struct opd_header; > - > -/** fill the sample file header with event info etc. */ > -void fill_header(struct opd_header * header, unsigned long counter, > - vma_t anon_start, vma_t anon_end, > - int is_kernel, int cg_to_is_kernel, > - int spu_samples, uint64_t embed_offset, time_t mtime); > - > -#endif /* OPD_EVENTS_H */ > diff --git a/daemon/opd_extended.c b/daemon/opd_extended.c > deleted file mode 100644 > index d4c8872..0000000 > --- a/daemon/opd_extended.c > +++ /dev/null > @@ -1,195 +0,0 @@ > -/** > - * @file opd_extended.c > - * OProfile Extended Feature > - * > - * @remark Copyright 2007-2009 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Suravee Suthikulpanit <[email protected]> > - * Copyright (c) 2009 Advanced Micro Devices, Inc. > - */ > - > -#include "opd_extended.h" > -#include "op_string.h" > - > -#include <string.h> > -#include <stdio.h> > - > -/* This global variable is >= 0 > - * if extended feature is enabled */ > -static int opd_ext_feat_index; > - > -extern struct opd_ext_handlers ibs_handlers; > - > -/** > - * OProfile Extended Feature Table > - * > - * This table contains a list of extended features. > - */ > -static struct opd_ext_feature ext_feature_table[] = { > - {"ibs", &ibs_handlers }, > - { NULL, NULL } > -}; > - > - > -static int get_index_for_feature(char const * name) > -{ > - int ret = -1; > - unsigned int i; > - > - if(!name) > - return ret; > - > - for (i = 0 ; ext_feature_table[i].feature != NULL ; i++ ) { > - if(!strncmp(name, ext_feature_table[i].feature, > - strlen(ext_feature_table[i].feature))) { > - ret = i; > - break; > - } > - } > - > - return ret; > -} > - > - > -static inline int is_ext_enabled() > -{ > - if (opd_ext_feat_index >= 0 > - && ext_feature_table[opd_ext_feat_index].handlers != NULL) > - return 1; > - else > - return 0; > -} > - > - > -static inline int is_ext_sfile_enabled() > -{ > - if (opd_ext_feat_index >= 0 > - && ext_feature_table[opd_ext_feat_index].handlers != NULL > - && ext_feature_table[opd_ext_feat_index].handlers->ext_sfile != NULL) > - return 1; > - else > - return 0; > -} > - > - > -/** > - * Param "value" is the input from CML option with the format: > - * > - * <feature name>:<param1>:<param2>:<param3>:..... > - * > - * where param1,2.3,..n are optional. > - */ > -int opd_ext_initialize(char const * value) > -{ > - int ret = EXIT_FAILURE; > - char * tmp = NULL, * name = NULL, * args = NULL; > - > - if(!value) { > - opd_ext_feat_index = -1; > - return 0; > - } > - > - tmp = op_xstrndup(value, strlen(value)); > - > - /* Parse feature name*/ > - if((name = strtok_r(tmp, ":", &args)) == NULL) > - goto err_out; > - > - if((opd_ext_feat_index = get_index_for_feature(name)) < 0) > - goto err_out; > - > - ret = ext_feature_table[opd_ext_feat_index].handlers->ext_init(args); > - > - return ret; > - > -err_out: > - fprintf(stderr,"opd_ext_initialize: Invalid extended feature option: %s\n", value); > - return ret; > -} > - > - > -int opd_ext_deinitialize() > -{ > - int ret = EXIT_FAILURE; > - > - if(opd_ext_feat_index == -1) { > - return 0; > - } > - > - ret = ext_feature_table[opd_ext_feat_index].handlers->ext_deinit(); > - > - return ret; > -} > - > - > -void opd_ext_print_stats() > -{ > - if (is_ext_enabled() > - && ext_feature_table[opd_ext_feat_index].handlers->ext_print_stats != NULL) { > - printf("\n-- OProfile Extended-Feature Statistics --\n"); > - ext_feature_table[opd_ext_feat_index].handlers->ext_print_stats(); > - } > -} > - > - > -/** > - * opd_sfile extended APIs > - */ > -void opd_ext_sfile_create(struct sfile * sf) > -{ > - /* Creating ext sfile only if extended feature is enable*/ > - if (is_ext_sfile_enabled() > - && ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->create != NULL) > - ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->create(sf); > -} > - > - > -void opd_ext_sfile_dup (struct sfile * to, struct sfile * from) > -{ > - /* Duplicate ext sfile only if extended feature is enable*/ > - if (is_ext_sfile_enabled() > - && ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->dup != NULL) > - ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->dup(to, from); > -} > - > - > -void opd_ext_sfile_close (struct sfile * sf) > -{ > - /* Close ext sfile only if extended feature is enable*/ > - if (is_ext_sfile_enabled() > - && ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->close != NULL) > - ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->close(sf); > -} > - > - > -void opd_ext_sfile_sync(struct sfile * sf) > -{ > - /* Sync ext sfile only if extended feature is enable*/ > - if (is_ext_sfile_enabled() > - && ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->sync != NULL) > - ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->sync(sf); > -} > - > - > -odb_t * opd_ext_sfile_get(struct transient const * trans, int is_cg) > -{ > - /* Get ext sfile only if extended feature is enable*/ > - if (is_ext_sfile_enabled() > - && ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->get != NULL) > - return ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->get(trans, is_cg); > - > - return NULL; > -} > - > - > -struct opd_event * opd_ext_find_counter_event(unsigned long counter) > -{ > - /* Only if extended feature is enable*/ > - if (is_ext_sfile_enabled() > - && ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->find_counter_event != NULL) > - return ext_feature_table[opd_ext_feat_index].handlers->ext_sfile->find_counter_event(counter); > - > - return NULL; > -} > - > diff --git a/daemon/opd_extended.h b/daemon/opd_extended.h > deleted file mode 100644 > index d7682a4..0000000 > --- a/daemon/opd_extended.h > +++ /dev/null > @@ -1,94 +0,0 @@ > -/** > - * @file opd_extended.h > - * OProfile Extended Feature > - * > - * @remark Copyright 2007-2009 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Suravee Suthikulpanit <[email protected]> > - * Copyright (c) 2009 Advanced Micro Devices, Inc. > - */ > - > -#ifndef OPD_EXTENDED_H > -#define OPD_EXTENDED_H > - > -#include "opd_trans.h" > -#include "odb.h" > - > -#include <stdlib.h> > -#include <stdint.h> > - > - > -/** > - * OProfile Extended Feature Table Entry > - */ > -struct opd_ext_feature { > - // Feature name > - const char* feature; > - // Feature handlers > - struct opd_ext_handlers * handlers; > -}; > - > -/** > - * OProfile Extended handlers > - */ > -struct opd_ext_handlers { > - // Extended init > - int (*ext_init)(char const *); > - // Extended deinit > - int (*ext_deinit)(); > - // Extended statistics > - int (*ext_print_stats)(); > - // Extended sfile handlers > - struct opd_ext_sfile_handlers * ext_sfile; > -}; > - > -/** > - * OProfile Extended sub-handlers (sfile) > - */ > -struct opd_ext_sfile_handlers { > - int (*create)(struct sfile *); > - int (*dup)(struct sfile *, struct sfile *); > - int (*close)(struct sfile *); > - int (*sync)(struct sfile *); > - odb_t * (*get)(struct transient const *, int); > - struct opd_event * (*find_counter_event)(unsigned long); > -}; > - > -/** > - * @param value: commandline input option string > - * > - * Parse the specified extended feature > - */ > -extern int opd_ext_initialize(char const * value); > - > -/** > - * @param value: commandline input option string > - * > - * Deinitialize > - */ > -extern int opd_ext_deinitialize(); > - > -/** > - * Print out extended feature statistics in oprofiled.log file > - */ > -extern void opd_ext_print_stats(); > - > -/** > - * opd_sfile extended sfile handling functions > - */ > -extern void opd_ext_sfile_create(struct sfile * sf); > -extern void opd_ext_sfile_dup (struct sfile * to, struct sfile * from); > -extern void opd_ext_sfile_close(struct sfile * sf); > -extern void opd_ext_sfile_sync(struct sfile * sf); > -extern odb_t * opd_ext_sfile_get(struct transient const * trans, int is_cg); > - > -/** > - * @param counter: counter index > - * > - * Get event struct opd_event from the counter index value. > - */ > -extern struct opd_event * opd_ext_find_counter_event(unsigned long counter); > - > - > -#endif > diff --git a/daemon/opd_ibs.c b/daemon/opd_ibs.c > deleted file mode 100644 > index 145ec2a..0000000 > --- a/daemon/opd_ibs.c > +++ /dev/null > @@ -1,837 +0,0 @@ > -/** > - * @file daemon/opd_ibs.c > - * AMD Family10h Instruction Based Sampling (IBS) handling. > - * > - * @remark Copyright 2007-2010 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Jason Yeh <[email protected]> > - * @author Paul Drongowski <[email protected]> > - * @author Suravee Suthikulpanit <[email protected]> > - * Copyright (c) 2008 Advanced Micro Devices, Inc. > - */ > - > -#include "op_hw_config.h" > -#include "op_events.h" > -#include "op_string.h" > -#include "op_hw_specific.h" > -#include "op_libiberty.h" > -#include "opd_printf.h" > -#include "opd_trans.h" > -#include "opd_events.h" > -#include "opd_kernel.h" > -#include "opd_anon.h" > -#include "opd_sfile.h" > -#include "opd_interface.h" > -#include "opd_mangling.h" > -#include "opd_extended.h" > -#include "opd_ibs.h" > -#include "opd_ibs_trans.h" > -#include "opd_ibs_macro.h" > - > -#include <stdlib.h> > -#include <stdio.h> > -#include <errno.h> > -#include <string.h> > -#include <limits.h> > - > -extern op_cpu cpu_type; > -extern int no_event_ok; > -extern int sfile_equal(struct sfile const * sf, struct sfile const * sf2); > -extern void sfile_dup(struct sfile * to, struct sfile * from); > -extern char * session_dir; > - > -/* IBS Select Counters */ > -static unsigned int ibs_selected_size; > - > -/* These flags store the IBS-derived events selection. */ > -static unsigned int ibs_fetch_selected_flag; > -static unsigned int ibs_op_selected_flag; > -static unsigned int ibs_op_ls_selected_flag; > -static unsigned int ibs_op_nb_selected_flag; > - > -/* IBS Statistics */ > -static unsigned long ibs_fetch_sample_stats; > -static unsigned long ibs_fetch_incomplete_stats; > -static unsigned long ibs_op_sample_stats; > -static unsigned long ibs_op_incomplete_stats; > -static unsigned long ibs_derived_event_stats; > - > -/* > - * IBS Virtual Counter > - */ > -struct opd_event ibs_vc[OP_MAX_IBS_COUNTERS]; > - > -/* IBS Virtual Counter Index(VCI) Map*/ > -unsigned int ibs_vci_map[OP_MAX_IBS_COUNTERS]; > - > -/* CPUID information */ > -unsigned int ibs_family; > -unsigned int ibs_model; > -unsigned int ibs_stepping; > - > -/* IBS Extended MSRs */ > -static unsigned long ibs_bta_enabled; > - > -/* IBS log files */ > -FILE * memaccess_log; > -FILE * bta_log; > - > -/** > - * This function converts IBS fetch event flags and values into > - * derived events. If the tagged (sampled) fetched caused a derived > - * event, the derived event is tallied. > - */ > -static void opd_log_ibs_fetch(struct transient * trans) > -{ > - struct ibs_fetch_sample * trans_fetch = ((struct ibs_sample*)(trans->ext))->fetch; > - if (!trans_fetch) > - return; > - > - trans_ibs_fetch(trans, ibs_fetch_selected_flag); > -} > - > - > -/** > - * This function translates the IBS op event flags and values into > - * IBS op derived events. If an op derived event occured, it's tallied. > - */ > -static void opd_log_ibs_op(struct transient * trans) > -{ > - struct ibs_op_sample * trans_op = ((struct ibs_sample*)(trans->ext))->op; > - if (!trans_op) > - return; > - > - trans_ibs_op_mask_reserved(ibs_family, trans); > - > - if (trans_ibs_op_rip_invalid(trans) != 0) > - return; > - > - trans_ibs_op(trans, ibs_op_selected_flag); > - trans_ibs_op_ls(trans, ibs_op_ls_selected_flag); > - trans_ibs_op_nb(trans, ibs_op_nb_selected_flag); > - trans_ibs_op_ls_memaccess(trans); > - trans_ibs_op_bta(trans); > -} > - > - > -static void opd_put_ibs_sample(struct transient * trans) > -{ > - unsigned long long event = 0; > - struct kernel_image * k_image = NULL; > - struct ibs_fetch_sample * trans_fetch = ((struct ibs_sample*)(trans->ext))->fetch; > - > - if (!enough_remaining(trans, 1)) { > - trans->remaining = 0; > - return; > - } > - > - /* IBS can generate samples with invalid dcookie and > - * in kernel address range. Map such samples to vmlinux > - * only if the user either specifies a range, or vmlinux. > - */ > - if (trans->cookie == INVALID_COOKIE > - && (k_image = find_kernel_image(trans)) != NULL > - && (k_image->start != 0 && k_image->end != 0) > - && trans->in_kernel == 0) > - trans->in_kernel = 1; > - > - if (trans->tracing != TRACING_ON) > - trans->event = event; > - > - /* sfile can change at each sample for kernel */ > - if (trans->in_kernel != 0) > - clear_trans_current(trans); > - > - if (!trans->in_kernel && trans->cookie == NO_COOKIE) > - trans->anon = find_anon_mapping(trans); > - > - /* get the current sfile if needed */ > - if (!trans->current) > - trans->current = sfile_find(trans); > - > - /* > - * can happen if kernel sample falls through the cracks, or if > - * it's a sample from an anon region we couldn't find > - */ > - if (!trans->current) > - goto out; > - > - if (trans_fetch) > - opd_log_ibs_fetch(trans); > - else > - opd_log_ibs_op(trans); > -out: > - /* switch to trace mode */ > - if (trans->tracing == TRACING_START) > - trans->tracing = TRACING_ON; > - > - update_trans_last(trans); > -} > - > - > -static void get_ibs_bta_status() > -{ > - FILE * fp = NULL; > - char buf[PATH_MAX]; > - > - /* Default to disable */ > - ibs_bta_enabled = 0; > - > - snprintf(buf, PATH_MAX, "/dev/oprofile/ibs_op/branch_target"); > - fp = fopen(buf, "r"); > - if (!fp) > - return; > - > - while (fgets(buf, PATH_MAX, fp) != NULL) > - ibs_bta_enabled = strtoul(buf, NULL, 10); > - > - fclose(fp); > -} > - > - > -void code_ibs_fetch_sample(struct transient * trans) > -{ > - struct ibs_fetch_sample * trans_fetch = NULL; > - > - if (!enough_remaining(trans, 7)) { > - verbprintf(vext, "not enough remaining\n"); > - trans->remaining = 0; > - ibs_fetch_incomplete_stats++; > - return; > - } > - > - ibs_fetch_sample_stats++; > - > - trans->ext = xmalloc(sizeof(struct ibs_sample)); > - ((struct ibs_sample*)(trans->ext))->fetch = xmalloc(sizeof(struct ibs_fetch_sample)); > - trans_fetch = ((struct ibs_sample*)(trans->ext))->fetch; > - > - trans_fetch->rip = pop_buffer_value(trans); > - > - trans_fetch->ibs_fetch_lin_addr_low = pop_buffer_value(trans); > - trans_fetch->ibs_fetch_lin_addr_high = pop_buffer_value(trans); > - > - trans_fetch->ibs_fetch_ctl_low = pop_buffer_value(trans); > - trans_fetch->ibs_fetch_ctl_high = pop_buffer_value(trans); > - trans_fetch->ibs_fetch_phys_addr_low = pop_buffer_value(trans); > - trans_fetch->ibs_fetch_phys_addr_high = pop_buffer_value(trans); > - > - verbprintf(vsamples, > - "FETCH_X CPU:%ld PID:%ld RIP:%lx CTL_H:%x LAT:%d P_HI:%x P_LO:%x L_HI:%x L_LO:%x\n", > - trans->cpu, > - (long)trans->tgid, > - trans_fetch->rip, > - (trans_fetch->ibs_fetch_ctl_high >> 16) & 0x3ff, > - (trans_fetch->ibs_fetch_ctl_high) & 0xffff, > - trans_fetch->ibs_fetch_phys_addr_high, > - trans_fetch->ibs_fetch_phys_addr_low, > - trans_fetch->ibs_fetch_lin_addr_high, > - trans_fetch->ibs_fetch_lin_addr_low) ; > - > - /* Overwrite the trans->pc with the more accurate trans_fetch->rip */ > - trans->pc = trans_fetch->rip; > - > - opd_put_ibs_sample(trans); > - > - free(trans_fetch); > - free(trans->ext); > - trans->ext = NULL; > -} > - > - > -static void get_ibs_op_bta_sample(struct transient * trans, > - struct ibs_op_sample * trans_op) > -{ > - // Check remaining > - if (!enough_remaining(trans, 2)) { > - verbprintf(vext, "not enough remaining\n"); > - trans->remaining = 0; > - ibs_op_incomplete_stats++; > - return; > - } > - > - if (ibs_bta_enabled == 1) { > - trans_op->ibs_op_brtgt_addr = pop_buffer_value(trans); > - > - // Check if branch target address is valid (MSRC001_1035[37] == 1] > - if ((trans_op->ibs_op_data1_high & (0x00000001 << 5)) == 0) { > - trans_op->ibs_op_brtgt_addr = 0; > - } > - } else { > - trans_op->ibs_op_brtgt_addr = 0; > - } > -} > - > - > -void code_ibs_op_sample(struct transient * trans) > -{ > - struct ibs_op_sample * trans_op= NULL; > - > - if (!enough_remaining(trans, 13)) { > - verbprintf(vext, "not enough remaining\n"); > - trans->remaining = 0; > - ibs_op_incomplete_stats++; > - return; > - } > - > - ibs_op_sample_stats++; > - > - trans->ext = xmalloc(sizeof(struct ibs_sample)); > - ((struct ibs_sample*)(trans->ext))->op = xmalloc(sizeof(struct ibs_op_sample)); > - trans_op = ((struct ibs_sample*)(trans->ext))->op; > - > - trans_op->rip = pop_buffer_value(trans); > - > - trans_op->ibs_op_lin_addr_low = pop_buffer_value(trans); > - trans_op->ibs_op_lin_addr_high = pop_buffer_value(trans); > - > - trans_op->ibs_op_data1_low = pop_buffer_value(trans); > - trans_op->ibs_op_data1_high = pop_buffer_value(trans); > - trans_op->ibs_op_data2_low = pop_buffer_value(trans); > - trans_op->ibs_op_data2_high = pop_buffer_value(trans); > - trans_op->ibs_op_data3_low = pop_buffer_value(trans); > - trans_op->ibs_op_data3_high = pop_buffer_value(trans); > - trans_op->ibs_op_ldst_linaddr_low = pop_buffer_value(trans); > - trans_op->ibs_op_ldst_linaddr_high = pop_buffer_value(trans); > - trans_op->ibs_op_phys_addr_low = pop_buffer_value(trans); > - trans_op->ibs_op_phys_addr_high = pop_buffer_value(trans); > - > - get_ibs_op_bta_sample(trans, trans_op); > - > - verbprintf(vsamples, > - "IBS_OP_X CPU:%ld PID:%d RIP:%lx D1HI:%x D1LO:%x D2LO:%x D3HI:%x D3LO:%x L_LO:%x P_LO:%x\n", > - trans->cpu, > - trans->tgid, > - trans_op->rip, > - trans_op->ibs_op_data1_high, > - trans_op->ibs_op_data1_low, > - trans_op->ibs_op_data2_low, > - trans_op->ibs_op_data3_high, > - trans_op->ibs_op_data3_low, > - trans_op->ibs_op_ldst_linaddr_low, > - trans_op->ibs_op_phys_addr_low); > - > - /* Overwrite the trans->pc with the more accurate trans_op->rip */ > - trans->pc = trans_op->rip; > - > - opd_put_ibs_sample(trans); > - > - free(trans_op); > - free(trans->ext); > - trans->ext = NULL; > -} > - > - > -/** Convert IBS event to value used for data structure indexing */ > -static unsigned long ibs_event_to_counter(unsigned long x) > -{ > - unsigned long ret = ~0UL; > - > - if (IS_IBS_FETCH(x)) > - ret = (x - IBS_FETCH_BASE); > - else if (IS_IBS_OP(x)) > - ret = (x - IBS_OP_BASE + IBS_FETCH_MAX); > - else if (IS_IBS_OP_LS(x)) > - ret = (x - IBS_OP_LS_BASE + IBS_OP_MAX + IBS_FETCH_MAX); > - else if (IS_IBS_OP_NB(x)) > - ret = (x - IBS_OP_NB_BASE + IBS_OP_LS_MAX + IBS_OP_MAX + IBS_FETCH_MAX); > - > - return (ret != ~0UL) ? ret + OP_MAX_COUNTERS : ret; > -} > - > - > -void opd_log_ibs_event(unsigned int event, > - struct transient * trans) > -{ > - ibs_derived_event_stats++; > - trans->event = event; > - sfile_log_sample_count(trans, 1); > -} > - > - > -void opd_log_ibs_count(unsigned int event, > - struct transient * trans, > - unsigned int count) > -{ > - ibs_derived_event_stats++; > - trans->event = event; > - sfile_log_sample_count(trans, count); > -} > - > - > -static unsigned long get_ibs_vci_key(unsigned int event) > -{ > - unsigned long key = ibs_event_to_counter(event); > - if (key == ~0UL || key < OP_MAX_COUNTERS) > - return ~0UL; > - > - key = key - OP_MAX_COUNTERS; > - > - return key; > -} > - > - > -static int ibs_parse_and_set_events(char * str) > -{ > - char * tmp, * ptr, * tok1, * tok2 = NULL; > - int is_done = 0; > - struct op_event * event = NULL; > - op_cpu cpu_type = CPU_NO_GOOD; > - unsigned long key; > - > - if (!str) > - return -1; > - > - cpu_type = op_get_cpu_type(); > - op_events(cpu_type); > - > - tmp = op_xstrndup(str, strlen(str)); > - ptr = tmp; > - > - while (is_done != 1 > - && (tok1 = strtok_r(ptr, ",", &tok2)) != NULL) { > - > - if ((ptr = strstr(tok1, ":")) != NULL) { > - *ptr = '\0'; > - is_done = 1; > - } > - > - // Resove event number > - event = find_event_by_name(tok1, 0, 0); > - if (!event) > - return -1; > - > - // Grouping > - if (IS_IBS_FETCH(event->val)) { > - ibs_fetch_selected_flag |= 1 << IBS_FETCH_OFFSET(event->val); > - } else if (IS_IBS_OP(event->val)) { > - ibs_op_selected_flag |= 1 << IBS_OP_OFFSET(event->val); > - } else if (IS_IBS_OP_LS(event->val)) { > - ibs_op_ls_selected_flag |= 1 << IBS_OP_LS_OFFSET(event->val); > - } else if (IS_IBS_OP_NB(event->val)) { > - ibs_op_nb_selected_flag |= 1 << IBS_OP_NB_OFFSET(event->val); > - } else { > - return -1; > - } > - > - key = get_ibs_vci_key(event->val); > - if (key == ~0UL) > - return -1; > - > - ibs_vci_map[key] = ibs_selected_size; > - > - /* Initialize part of ibs_vc */ > - ibs_vc[ibs_selected_size].name = tok1; > - ibs_vc[ibs_selected_size].value = event->val; > - ibs_vc[ibs_selected_size].counter = ibs_selected_size + OP_MAX_COUNTERS; > - ibs_vc[ibs_selected_size].kernel = 1; > - ibs_vc[ibs_selected_size].user = 1; > - > - ibs_selected_size++; > - > - ptr = NULL; > - } > - > - return 0; > -} > - > - > -static int ibs_parse_counts(char * str, unsigned long int * count) > -{ > - char * tmp, * tok1, * tok2 = NULL, *end = NULL; > - if (!str) > - return -1; > - > - tmp = op_xstrndup(str, strlen(str)); > - tok1 = strtok_r(tmp, ":", &tok2); > - if (tok1) { > - *count = strtoul(tok1, &end, 10); > - } else { > - fprintf(stderr, "Invalid count specification in %s\n", str); > - return -1; > - } > - if ((end && *end) || *count == 0 > - || errno == EINVAL || errno == ERANGE) { > - fprintf(stderr,"Invalid count (%s)\n", str); > - return -1; > - } > - > - return 0; > -} > - > - > -static int ibs_parse_and_set_um_fetch(char const * str) > -{ > - if (!str) > - return -1; > - return 0; > -} > - > - > -static int ibs_parse_and_set_um_op(char const * str, unsigned long int * ibs_op_um) > -{ > - char * end = NULL; > - if (!str) > - return -1; > - > - *ibs_op_um = strtoul(str, &end, 16); > - if ((end && *end) || errno == EINVAL || errno == ERANGE) { > - fprintf(stderr,"Invalid unitmaks (%s)\n", str); > - return -1; > - } > - return 0; > -} > - > - > -static void check_cpuid_family_model_stepping() > -{ > -#if defined(__i386__) || defined(__x86_64__) > - unsigned eax = cpuid_signature(); > - > - ibs_family = cpu_family(eax); > - ibs_model = cpu_model(eax); > - ibs_stepping = cpu_stepping(eax); > -#else > - ibs_family = 0; > - ibs_model = 0; > - ibs_stepping = 0; > -#endif > -} > - > - > -static int ibs_init(char const * argv) > -{ > - char * tmp, * ptr, * tok1, * tok2 = NULL; > - unsigned int i = 0; > - unsigned long int ibs_fetch_count = 0; > - unsigned long int ibs_op_count = 0; > - unsigned long int ibs_op_um = 0; > - > - if (!argv) > - return -1; > - > - if (empty_line(argv) != 0) > - return -1; > - > - tmp = op_xstrndup(argv, strlen(argv)); > - ptr = (char *) skip_ws(tmp); > - > - // "fetch:event1,event2,....:count:um|op:event1,event2,.....:count:um" > - tok1 = strtok_r(ptr, "|", &tok2); > - > - while (tok1 != NULL) { > - > - if (!strncmp("fetch:", tok1, strlen("fetch:"))) { > - // Get to event section > - tok1 = tok1 + strlen("fetch:"); > - if (ibs_parse_and_set_events(tok1) == -1) > - return -1; > - > - // Get to count section > - while (tok1) { > - if (*tok1 == '\0') > - return -1; > - if (*tok1 != ':') { > - tok1++; > - } else { > - tok1++; > - break; > - } > - } > - > - if (ibs_parse_counts(tok1, &ibs_fetch_count) == -1) > - return -1; > - > - // Get to um section > - while (tok1) { > - if (*tok1 == '\0') > - return -1; > - if (*tok1 != ':') { > - tok1++; > - } else { > - tok1++; > - break; > - } > - } > - > - if (ibs_parse_and_set_um_fetch(tok1) == -1) > - return -1; > - > - } else if (!strncmp("op:", tok1, strlen("op:"))) { > - // Get to event section > - tok1 = tok1 + strlen("op:"); > - if (ibs_parse_and_set_events(tok1) == -1) > - return -1; > - > - // Get to count section > - while (tok1) { > - if (*tok1 == '\0') > - return -1; > - if (*tok1 != ':') { > - tok1++; > - } else { > - tok1++; > - break; > - } > - } > - > - if (ibs_parse_counts(tok1, &ibs_op_count) == -1) > - return -1; > - > - // Get to um section > - while (tok1) { > - if (*tok1 == '\0') > - return -1; > - if (*tok1 != ':') { > - tok1++; > - } else { > - tok1++; > - break; > - } > - } > - > - if (ibs_parse_and_set_um_op(tok1, &ibs_op_um)) > - return -1; > - > - } else > - return -1; > - > - tok1 = strtok_r(NULL, "|", &tok2); > - } > - > - /* Initialize ibs_vc */ > - for (i = 0 ; i < ibs_selected_size ; i++) > - { > - if (IS_IBS_FETCH(ibs_vc[i].value)) { > - ibs_vc[i].count = ibs_fetch_count; > - ibs_vc[i].um = 0; > - } else { > - ibs_vc[i].count = ibs_op_count; > - ibs_vc[i].um = ibs_op_um; > - } > - } > - > - // Allow no event > - no_event_ok = 1; > - > - check_cpuid_family_model_stepping(); > - > - get_ibs_bta_status(); > - > - /* Create IBS memory access log */ > - memaccess_log = NULL; > - if (ibs_op_um & 0x2) { > - char filename[PATH_MAX]; > - char * log_file = "/samples/ibs_memaccess.log"; > - size_t path_len = strlen(session_dir) + strlen(log_file); > - if (path_len < PATH_MAX) { > - strcpy(filename, session_dir); > - strcat(filename, log_file); > - memaccess_log = fopen(filename, "w"); > - } > - if ( memaccess_log == NULL) { > - verbprintf(vext, "Warning: Cannot create ibs_memaccess.log\n"); > - > - } else { > - fprintf (memaccess_log, "# IBS Memory Access Log\n\n"); > - fprintf (memaccess_log, "# Format: app_cookie,cookie,cpu,tgid,tid,pc,branch-target-address,\n"); > - fprintf (memaccess_log, "# phy-hi:phy-low,lin-hi:lin-low,accese-type,latency\n\n"); > - } > - } > - > - // Create IBS Branch Target Address (BTA) log > - bta_log = NULL; > - if (ibs_bta_enabled) { > - char filename[PATH_MAX]; > - char * log_file = "/samples/ibs_bta.log"; > - size_t path_len = strlen(session_dir) + strlen(log_file); > - if (path_len < PATH_MAX) { > - strcpy(filename, session_dir); > - strcat(filename, log_file); > - bta_log = fopen(filename, "w"); > - } > - if ( bta_log == NULL) { > - verbprintf(vext, "Warning: Cannot create ibs_bta.log\n"); > - } else { > - fprintf (bta_log, "# IBS Memory Access Log\n\n"); > - fprintf (bta_log, "# Format: app_cookie,cookie,cpu,tgid,tid,pc,branch-target-address\n\n"); > - } > - } > - > - return 0; > -} > - > - > -static int ibs_deinit() > -{ > - if (memaccess_log) { > - fclose (memaccess_log); > - memaccess_log = NULL; > - } > - > - if (bta_log) { > - fclose (bta_log); > - bta_log = NULL; > - } > - return 0; > -} > - > - > -static int ibs_print_stats() > -{ > - printf("Nr. IBS Fetch samples : %lu (%lu entries)\n", > - ibs_fetch_sample_stats, (ibs_fetch_sample_stats * 7)); > - printf("Nr. IBS Fetch incompletes : %lu\n", ibs_fetch_incomplete_stats); > - printf("Nr. IBS Op samples : %lu (%lu entries)\n", > - ibs_op_sample_stats, (ibs_op_sample_stats * 13)); > - printf("Nr. IBS Op incompletes : %lu\n", ibs_op_incomplete_stats); > - printf("Nr. IBS derived events : %lu\n", ibs_derived_event_stats); > - return 0; > -} > - > - > -static int ibs_sfile_create(struct sfile * sf) > -{ > - unsigned int i; > - sf->ext_files = xmalloc(ibs_selected_size * sizeof(odb_t)); > - for (i = 0 ; i < ibs_selected_size ; ++i) > - odb_init(&sf->ext_files[i]); > - > - return 0; > -} > - > - > -static int ibs_sfile_dup (struct sfile * to, struct sfile * from) > -{ > - unsigned int i; > - if (from->ext_files != NULL) { > - to->ext_files = xmalloc(ibs_selected_size * sizeof(odb_t)); > - for (i = 0 ; i < ibs_selected_size ; ++i) > - odb_init(&to->ext_files[i]); > - } else { > - to->ext_files = NULL; > - } > - return 0; > -} > - > -static int ibs_sfile_close(struct sfile * sf) > -{ > - unsigned int i; > - if (sf->ext_files != NULL) { > - for (i = 0; i < ibs_selected_size ; ++i) > - odb_close(&sf->ext_files[i]); > - > - free(sf->ext_files); > - sf->ext_files= NULL; > - } > - return 0; > -} > - > -static int ibs_sfile_sync(struct sfile * sf) > -{ > - unsigned int i; > - if (sf->ext_files != NULL) { > - for (i = 0; i < ibs_selected_size ; ++i) > - odb_sync(&sf->ext_files[i]); > - } > - return 0; > -} > - > -static odb_t * ibs_sfile_get(struct transient const * trans, int is_cg) > -{ > - struct sfile * sf = trans->current; > - struct sfile * last = trans->last; > - struct cg_entry * cg; > - struct list_head * pos; > - unsigned long hash; > - odb_t * file; > - unsigned long counter, ibs_vci, key; > - > - /* Note: "trans->event" for IBS is not the same as traditional > - * events. Here, it has the actual event (0xfxxx), while the > - * traditional event has the event index. > - */ > - key = get_ibs_vci_key(trans->event); > - if (key == ~0UL) { > - fprintf(stderr, "%s: Invalid IBS event %lu\n", __func__, trans->event); > - abort(); > - } > - ibs_vci = ibs_vci_map[key]; > - counter = ibs_vci + OP_MAX_COUNTERS; > - > - /* Creating IBS sfile if it not already exists */ > - if (sf->ext_files == NULL) > - ibs_sfile_create(sf); > - > - file = &(sf->ext_files[ibs_vci]); > - if (!is_cg) > - goto open; > - > - hash = last->hashval & (CG_HASH_SIZE - 1); > - > - /* Need to look for the right 'to'. Since we're looking for > - * 'last', we use its hash. > - */ > - list_for_each(pos, &sf->cg_hash[hash]) { > - cg = list_entry(pos, struct cg_entry, hash); > - if (sfile_equal(last, &cg->to)) { > - file = &(cg->to.ext_files[ibs_vci]); > - goto open; > - } > - } > - > - cg = xmalloc(sizeof(struct cg_entry)); > - sfile_dup(&cg->to, last); > - list_add(&cg->hash, &sf->cg_hash[hash]); > - file = &(cg->to.ext_files[ibs_vci]); > - > -open: > - if (!odb_open_count(file)) > - opd_open_sample_file(file, last, sf, counter, is_cg); > - > - /* Error is logged by opd_open_sample_file */ > - if (!odb_open_count(file)) > - return NULL; > - > - return file; > -} > - > - > -/** Filled opd_event structure with IBS derived event information > - * from the given counter value. > - */ > -static struct opd_event * ibs_sfile_find_counter_event(unsigned long counter) > -{ > - unsigned long ibs_vci; > - > - if (counter >= OP_MAX_COUNTERS + OP_MAX_IBS_COUNTERS > - || counter < OP_MAX_COUNTERS) { > - fprintf(stderr,"Error: find_ibs_counter_event : " > - "invalid counter value %lu.\n", counter); > - abort(); > - } > - > - ibs_vci = counter - OP_MAX_COUNTERS; > - return &ibs_vc[ibs_vci]; > -} > - > - > -struct opd_ext_sfile_handlers ibs_sfile_handlers = > -{ > - .create = &ibs_sfile_create, > - .dup = &ibs_sfile_dup, > - .close = &ibs_sfile_close, > - .sync = &ibs_sfile_sync, > - .get = &ibs_sfile_get, > - .find_counter_event = &ibs_sfile_find_counter_event > -}; > - > - > -struct opd_ext_handlers ibs_handlers = > -{ > - .ext_init = &ibs_init, > - .ext_deinit = &ibs_deinit, > - .ext_print_stats = &ibs_print_stats, > - .ext_sfile = &ibs_sfile_handlers > -}; > diff --git a/daemon/opd_ibs.h b/daemon/opd_ibs.h > deleted file mode 100644 > index 6f0fd64..0000000 > --- a/daemon/opd_ibs.h > +++ /dev/null > @@ -1,133 +0,0 @@ > -/** > - * @file daemon/opd_ibs.h > - * AMD Family10h Instruction Based Sampling (IBS) handling. > - * > - * @remark Copyright 2008-2010 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Jason Yeh <[email protected]> > - * @author Paul Drongowski <[email protected]> > - * @author Suravee Suthikulpanit <[email protected]> > - * Copyright (c) 2008 Advanced Micro Devices, Inc. > - */ > - > -#ifndef OPD_IBS_H > -#define OPD_IBS_H > - > -#include <stdint.h> > - > -#include "opd_ibs_macro.h" > - > -struct transient; > -struct opd_event; > - > -/** > - * IBS information is processed in two steps. The first step decodes > - * hardware-level IBS information and saves it in decoded form. The > - * second step translates the decoded IBS information into IBS derived > - * events. IBS information is tallied and is reported as derived events. > - */ > - > -struct ibs_sample { > - struct ibs_fetch_sample * fetch; > - struct ibs_op_sample * op; > -}; > - > -/** > - * This struct represents the hardware-level IBS fetch information. > - * Each field corresponds to a model-specific register (MSR.) See the > - * BIOS and Kernel Developer's Guide for AMD Model Family 10h Processors > - * for further details. > - */ > -struct ibs_fetch_sample { > - unsigned long int rip; > - /* MSRC001_1030 IBS Fetch Control Register */ > - unsigned int ibs_fetch_ctl_low; > - unsigned int ibs_fetch_ctl_high; > - /* MSRC001_1031 IBS Fetch Linear Address Register */ > - unsigned int ibs_fetch_lin_addr_low; > - unsigned int ibs_fetch_lin_addr_high; > - /* MSRC001_1032 IBS Fetch Physical Address Register */ > - unsigned int ibs_fetch_phys_addr_low; > - unsigned int ibs_fetch_phys_addr_high; > - unsigned int dummy_event; > -}; > - > - > - > -/** This struct represents the hardware-level IBS op information. */ > -struct ibs_op_sample { > - unsigned long int rip; > - /* MSRC001_1034 IBS Op Logical Address Register */ > - unsigned int ibs_op_lin_addr_low; > - unsigned int ibs_op_lin_addr_high; > - /* MSRC001_1035 IBS Op Data Register */ > - unsigned int ibs_op_data1_low; > - unsigned int ibs_op_data1_high; > - /* MSRC001_1036 IBS Op Data 2 Register */ > - unsigned int ibs_op_data2_low; > - unsigned int ibs_op_data2_high; > - /* MSRC001_1037 IBS Op Data 3 Register */ > - unsigned int ibs_op_data3_low; > - unsigned int ibs_op_data3_high; > - /* MSRC001_1038 IBS DC Linear Address */ > - unsigned int ibs_op_ldst_linaddr_low; > - unsigned int ibs_op_ldst_linaddr_high; > - /* MSRC001_1039 IBS DC Physical Address */ > - unsigned int ibs_op_phys_addr_low; > - unsigned int ibs_op_phys_addr_high; > - /* MSRC001_103B IBS Branch Target Address */ > - unsigned long ibs_op_brtgt_addr; > -}; > - > - > -/** > - * Handle an IBS fetch sample escape code sequence. An IBS fetch sample > - * is represented as an escape code sequence. (See the comment for the > - * function code_ibs_op_sample() for the sequence of entries in the event > - * buffer.) When this function is called, the ESCAPE_CODE and IBS_FETCH_CODE > - * have already been removed from the event buffer. Thus, 7 more event buffer > - * entries are needed in order to process a complete IBS fetch sample. > - */ > -extern void code_ibs_fetch_sample(struct transient * trans); > - > -/** > - * Handle an IBS op sample escape code sequence. An IBS op sample > - * is represented as an escape code sequence: > - * > - * IBS fetch IBS op > - * --------------- ---------------- > - * ESCAPE_CODE ESCAPE_CODE > - * IBS_FETCH_CODE IBS_OP_CODE > - * Offset Offset > - * IbsFetchLinAd low IbsOpRip low <-- Logical (virtual) RIP > - * IbsFetchLinAd high IbsOpRip high <-- Logical (virtual) RIP > - * IbsFetchCtl low IbsOpData low > - * IbsFetchCtl high IbsOpData high > - * IbsFetchPhysAd low IbsOpData2 low > - * IbsFetchPhysAd high IbsOpData2 high > - * IbsOpData3 low > - * IbsOpData3 high > - * IbsDcLinAd low > - * IbsDcLinAd high > - * IbsDcPhysAd low > - * IbsDcPhysAd high > - * > - * When this function is called, the ESCAPE_CODE and IBS_OP_CODE have > - * already been removed from the event buffer. Thus, 13 more event buffer > - * entries are needed to process a complete IBS op sample. > - * > - * The IbsFetchLinAd and IbsOpRip are the linear (virtual) addresses > - * that were generated by the IBS hardware. These addresses are mapped > - * into the offset. > - */ > -extern void code_ibs_op_sample(struct transient * trans); > - > -/** Log the specified IBS derived event. */ > -extern void opd_log_ibs_event(unsigned int event, struct transient * trans); > - > -/** Log the specified IBS cycle count. */ > -extern void opd_log_ibs_count(unsigned int event, struct transient * trans, unsigned int count); > - > - > -#endif /*OPD_IBS_H*/ > diff --git a/daemon/opd_ibs_macro.h b/daemon/opd_ibs_macro.h > deleted file mode 100644 > index 0bfcf17..0000000 > --- a/daemon/opd_ibs_macro.h > +++ /dev/null > @@ -1,397 +0,0 @@ > -/** > - * @file daemon/opd_ibs_macro.h > - * AMD Instruction Based Sampling (IBS) related macro. > - * > - * @remark Copyright 2008-2010 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Jason Yeh <[email protected]> > - * @author Paul Drongowski <[email protected]> > - * @author Suravee Suthikulpanit <[email protected]> > - * Copyright (c) 2008 Advanced Micro Devices, Inc. > - */ > - > -#ifndef OPD_IBS_MACRO_H > -#define OPD_IBS_MACRO_H > - > -/** > - * The following defines are bit masks that are used to select > - * IBS fetch event flags and values at the > - * MSRC001_1030 IBS Fetch Control Register (IbsFetchCtl) > - */ > -#define FETCH_MASK_LATENCY 0x0000ffff > -#define FETCH_MASK_COMPLETE 0x00040000 > -#define FETCH_MASK_IC_MISS 0x00080000 > -#define FETCH_MASK_PHY_ADDR 0x00100000 > -#define FETCH_MASK_PG_SIZE 0x00600000 > -#define FETCH_MASK_L1_MISS 0x00800000 > -#define FETCH_MASK_L2_MISS 0x01000000 > -#define FETCH_MASK_KILLED \ > - (FETCH_MASK_L1_MISS|FETCH_MASK_L2_MISS|FETCH_MASK_PHY_ADDR|\ > - FETCH_MASK_COMPLETE|FETCH_MASK_IC_MISS) > - > - > -/** > - * The following defines are bit masks that are used to select > - * IBS op event flags and values at the MSR level. > - */ > - > -/* MSRC001_1035 IBS Op Data Register (IbsOpData) */ > -#define BR_MASK_RETIRE 0x0000ffff > -#define MASK_RIP_INVALID 0x00000040 > -#define BR_MASK_BRN_RET 0x00000020 > -#define BR_MASK_BRN_MISP 0x00000010 > -#define BR_MASK_BRN_TAKEN 0x00000008 > -#define BR_MASK_RETURN 0x00000004 > -#define BR_MASK_MISP_RETURN 0x00000002 > -#define BR_MASK_BRN_RESYNC 0x00000001 > - > -/* MSRC001_1036 IBS Op Data Register (IbsOpData2) */ > -#define NB_MASK_L3_STATE 0x00000020 > -#define NB_MASK_REQ_DST_PROC 0x00000010 > -#define NB_MASK_REQ_DATA_SRC 0x00000007 > - > -/* MSRC001_1037 IBS Op Data Register (IbsOpData3) */ > -#define DC_MASK_L2_HIT_1G 0x00080000 > -#define DC_MASK_PHY_ADDR_VALID 0x00040000 > -#define DC_MASK_LIN_ADDR_VALID 0x00020000 > -#define DC_MASK_MAB_HIT 0x00010000 > -#define DC_MASK_LOCKED_OP 0x00008000 > -#define DC_MASK_UC_MEM_ACCESS 0x00004000 > -#define DC_MASK_WC_MEM_ACCESS 0x00002000 > -#define DC_MASK_ST_TO_LD_CANCEL 0x00001000 > -#define DC_MASK_ST_TO_LD_FOR 0x00000800 > -#define DC_MASK_ST_BANK_CONFLICT 0x00000400 > -#define DC_MASK_LD_BANK_CONFLICT 0x00000200 > -#define DC_MASK_MISALIGN_ACCESS 0x00000100 > -#define DC_MASK_DC_MISS 0x00000080 > -#define DC_MASK_L2_HIT_2M 0x00000040 > -#define DC_MASK_L1_HIT_1G 0x00000020 > -#define DC_MASK_L1_HIT_2M 0x00000010 > -#define DC_MASK_L2_TLB_MISS 0x00000008 > -#define DC_MASK_L1_TLB_MISS 0x00000004 > -#define DC_MASK_STORE_OP 0x00000002 > -#define DC_MASK_LOAD_OP 0x00000001 > - > - > -/** > - * IBS derived events: > - * > - * IBS derived events are identified by event select values which are > - * similar to the event select values that identify performance monitoring > - * counter (PMC) events. Event select values for IBS derived events begin > - * at 0xf000. > - * > - * The definitions in this file *must* match definitions > - * of IBS derived events. More information > - * about IBS derived events is given in the Software Oprimization > - * Guide. > - */ > - > -/** > - * The following defines associate a 16-bit select value with an IBS > - * derived fetch event. > - */ > -#define DE_IBS_FETCH_ALL 0xf000 > -#define DE_IBS_FETCH_KILLED 0xf001 > -#define DE_IBS_FETCH_ATTEMPTED 0xf002 > -#define DE_IBS_FETCH_COMPLETED 0xf003 > -#define DE_IBS_FETCH_ABORTED 0xf004 > -#define DE_IBS_L1_ITLB_HIT 0xf005 > -#define DE_IBS_ITLB_L1M_L2H 0xf006 > -#define DE_IBS_ITLB_L1M_L2M 0xf007 > -#define DE_IBS_IC_MISS 0xf008 > -#define DE_IBS_IC_HIT 0xf009 > -#define DE_IBS_FETCH_4K_PAGE 0xf00a > -#define DE_IBS_FETCH_2M_PAGE 0xf00b > -#define DE_IBS_FETCH_1G_PAGE 0xf00c > -#define DE_IBS_FETCH_XX_PAGE 0xf00d > -#define DE_IBS_FETCH_LATENCY 0xf00e > - > -#define IBS_FETCH_BASE 0xf000 > -#define IBS_FETCH_END 0xf00e > -#define IBS_FETCH_MAX (IBS_FETCH_END - IBS_FETCH_BASE + 1) > -#define IS_IBS_FETCH(x) (IBS_FETCH_BASE <= x && x <= IBS_FETCH_END) > -#define IBS_FETCH_OFFSET(x) (x - IBS_FETCH_BASE) > -#define CHECK_FETCH_SELECTED_FLAG(x) if ( selected_flag & (1 << IBS_FETCH_OFFSET(x))) > - > - > -/** > - * The following defines associate a 16-bit select value with an IBS > - * derived branch/return macro-op event. > - */ > -#define DE_IBS_OP_ALL 0xf100 > -#define DE_IBS_OP_TAG_TO_RETIRE 0xf101 > -#define DE_IBS_OP_COMP_TO_RETIRE 0xf102 > -#define DE_IBS_BRANCH_RETIRED 0xf103 > -#define DE_IBS_BRANCH_MISP 0xf104 > -#define DE_IBS_BRANCH_TAKEN 0xf105 > -#define DE_IBS_BRANCH_MISP_TAKEN 0xf106 > -#define DE_IBS_RETURN 0xf107 > -#define DE_IBS_RETURN_MISP 0xf108 > -#define DE_IBS_RESYNC 0xf109 > - > -#define IBS_OP_BASE 0xf100 > -#define IBS_OP_END 0xf109 > -#define IBS_OP_MAX (IBS_OP_END - IBS_OP_BASE + 1) > -#define IS_IBS_OP(x) (IBS_OP_BASE <= x && x <= IBS_OP_END) > -#define IBS_OP_OFFSET(x) (x - IBS_OP_BASE) > -#define CHECK_OP_SELECTED_FLAG(x) if ( selected_flag & (1 << IBS_OP_OFFSET(x))) > - > - > -/** > - * The following defines associate a 16-bit select value with an IBS > - * derived load/store event. > - */ > -#define DE_IBS_LS_ALL_OP 0xf200 > -#define DE_IBS_LS_LOAD_OP 0xf201 > -#define DE_IBS_LS_STORE_OP 0xf202 > -#define DE_IBS_LS_DTLB_L1H 0xf203 > -#define DE_IBS_LS_DTLB_L1M_L2H 0xf204 > -#define DE_IBS_LS_DTLB_L1M_L2M 0xf205 > -#define DE_IBS_LS_DC_MISS 0xf206 > -#define DE_IBS_LS_DC_HIT 0xf207 > -#define DE_IBS_LS_MISALIGNED 0xf208 > -#define DE_IBS_LS_BNK_CONF_LOAD 0xf209 > -#define DE_IBS_LS_BNK_CONF_STORE 0xf20a > -#define DE_IBS_LS_STL_FORWARDED 0xf20b > -#define DE_IBS_LS_STL_CANCELLED 0xf20c > -#define DE_IBS_LS_UC_MEM_ACCESS 0xf20d > -#define DE_IBS_LS_WC_MEM_ACCESS 0xf20e > -#define DE_IBS_LS_LOCKED_OP 0xf20f > -#define DE_IBS_LS_MAB_HIT 0xf210 > -#define DE_IBS_LS_L1_DTLB_4K 0xf211 > -#define DE_IBS_LS_L1_DTLB_2M 0xf212 > -#define DE_IBS_LS_L1_DTLB_1G 0xf213 > -#define DE_IBS_LS_L1_DTLB_RES 0xf214 > -#define DE_IBS_LS_L2_DTLB_4K 0xf215 > -#define DE_IBS_LS_L2_DTLB_2M 0xf216 > -#define DE_IBS_LS_L2_DTLB_1G 0xf217 > -#define DE_IBS_LS_L2_DTLB_RES2 0xf218 > -#define DE_IBS_LS_DC_LOAD_LAT 0xf219 > - > -#define IBS_OP_LS_BASE 0xf200 > -#define IBS_OP_LS_END 0xf219 > -#define IBS_OP_LS_MAX (IBS_OP_LS_END - IBS_OP_LS_BASE + 1) > -#define IS_IBS_OP_LS(x) (IBS_OP_LS_BASE <= x && x <= IBS_OP_LS_END) > -#define IBS_OP_LS_OFFSET(x) (x - IBS_OP_LS_BASE) > -#define CHECK_OP_LS_SELECTED_FLAG(x) if ( selected_flag & (1 << IBS_OP_LS_OFFSET(x))) > - > - > -/** > - * The following defines associate a 16-bit select value with an IBS > - * derived Northbridge (NB) event. > - */ > -#define DE_IBS_NB_LOCAL 0xf240 > -#define DE_IBS_NB_REMOTE 0xf241 > -#define DE_IBS_NB_LOCAL_L3 0xf242 > -#define DE_IBS_NB_LOCAL_CACHE 0xf243 > -#define DE_IBS_NB_REMOTE_CACHE 0xf244 > -#define DE_IBS_NB_LOCAL_DRAM 0xf245 > -#define DE_IBS_NB_REMOTE_DRAM 0xf246 > -#define DE_IBS_NB_LOCAL_OTHER 0xf247 > -#define DE_IBS_NB_REMOTE_OTHER 0xf248 > -#define DE_IBS_NB_CACHE_STATE_M 0xf249 > -#define DE_IBS_NB_CACHE_STATE_O 0xf24a > -#define DE_IBS_NB_LOCAL_LATENCY 0xf24b > -#define DE_IBS_NB_REMOTE_LATENCY 0xf24c > - > -#define IBS_OP_NB_BASE 0xf240 > -#define IBS_OP_NB_END 0xf24c > -#define IBS_OP_NB_MAX (IBS_OP_NB_END - IBS_OP_NB_BASE + 1) > -#define IS_IBS_OP_NB(x) (IBS_OP_NB_BASE <= x && x <= IBS_OP_NB_END) > -#define IBS_OP_NB_OFFSET(x) (x - IBS_OP_NB_BASE) > -#define CHECK_OP_NB_SELECTED_FLAG(x) if ( selected_flag & (1 << IBS_OP_NB_OFFSET(x))) > - > - > -#define OP_MAX_IBS_COUNTERS (IBS_FETCH_MAX + IBS_OP_MAX + IBS_OP_LS_MAX + IBS_OP_NB_MAX) > - > - > -/** > - * These macro decodes IBS hardware-level event flags and fields. > - * Translation results are either zero (false) or non-zero (true), except > - * the fetch latency, which is a 16-bit cycle count, and the fetch page size > - * field, which is a 2-bit unsigned integer. > - */ > - > -/** Bits 47:32 IbsFetchLat: instruction fetch latency */ > -#define IBS_FETCH_FETCH_LATENCY(x) ((unsigned short)(x->ibs_fetch_ctl_high & FETCH_MASK_LATENCY)) > - > -/** Bit 50 IbsFetchComp: instruction fetch complete. */ > -#define IBS_FETCH_FETCH_COMPLETION(x) ((x->ibs_fetch_ctl_high & FETCH_MASK_COMPLETE) != 0) > - > -/** Bit 51 IbsIcMiss: instruction cache miss. */ > -#define IBS_FETCH_INST_CACHE_MISS(x) ((x->ibs_fetch_ctl_high & FETCH_MASK_IC_MISS) != 0) > - > -/** Bit 52 IbsPhyAddrValid: instruction fetch physical address valid. */ > -#define IBS_FETCH_PHYS_ADDR_VALID(x) ((x->ibs_fetch_ctl_high & FETCH_MASK_PHY_ADDR) != 0) > - > -enum IBSL1PAGESIZE { > - L1TLB4K = 0, > - L1TLB2M, > - L1TLB1G, > - L1TLB_INVALID > -}; > - > -/** Bits 54:53 IbsL1TlbPgSz: instruction cache L1TLB page size. */ > -#define IBS_FETCH_TLB_PAGE_SIZE(x) ((unsigned short)((x->ibs_fetch_ctl_high >> 21) & 0x3)) > -#define IBS_FETCH_TLB_PAGE_SIZE_4K(x) (IBS_FETCH_TLB_PAGE_SIZE(x) == L1TLB4K) > -#define IBS_FETCH_TLB_PAGE_SIZE_2M(x) (IBS_FETCH_TLB_PAGE_SIZE(x) == L1TLB2M) > -#define IBS_FETCH_TLB_PAGE_SIZE_1G(x) (IBS_FETCH_TLB_PAGE_SIZE(x) == L1TLB1G) > - > -/** Bit 55 IbsL1TlbMiss: instruction cache L1TLB miss. */ > -#define IBS_FETCH_M_L1_TLB_MISS(x) ((x->ibs_fetch_ctl_high & FETCH_MASK_L1_MISS) != 0) > - > -/** Bit 56 IbsL2TlbMiss: instruction cache L2TLB miss. */ > -#define IBS_FETCH_L2_TLB_MISS(x) ((x->ibs_fetch_ctl_high & FETCH_MASK_L2_MISS) != 0) > - > -/** A fetch is a killed fetch if all the masked bits are clear */ > -#define IBS_FETCH_KILLED(x) ((x->ibs_fetch_ctl_high & FETCH_MASK_KILLED) == 0) > - > -#define IBS_FETCH_INST_CACHE_HIT(x) (IBS_FETCH_FETCH_COMPLETION(x) && !IBS_FETCH_INST_CACHE_MISS(x)) > - > -#define IBS_FETCH_L1_TLB_HIT(x) (!IBS_FETCH_M_L1_TLB_MISS(x) && IBS_FETCH_PHYS_ADDR_VALID(x)) > - > -#define IBS_FETCH_ITLB_L1M_L2H(x) (IBS_FETCH_M_L1_TLB_MISS(x) && !IBS_FETCH_L2_TLB_MISS(x)) > - > -#define IBS_FETCH_ITLB_L1M_L2M(x) (IBS_FETCH_M_L1_TLB_MISS(x) && IBS_FETCH_L2_TLB_MISS(x)) > - > - > -/** > - * These macros translates IBS op event data from its hardware-level > - * representation .It hides the MSR layout of IBS op data. > - */ > - > -/** > - * MSRC001_1035 IBS OP Data Register (IbsOpData) > - * > - * 15:0 IbsCompToRetCtr: macro-op completion to retire count > - */ > -#define IBS_OP_COM_TO_RETIRE_CYCLES(x) ((unsigned short)(x->ibs_op_data1_low & BR_MASK_RETIRE)) > - > -/** 31:16 tag_to_retire_cycles : macro-op tag to retire count. */ > -#define IBS_OP_TAG_TO_RETIRE_CYCLES(x) ((unsigned short)((x->ibs_op_data1_low >> 16) & BR_MASK_RETIRE)) > - > -/** 32 op_branch_resync : resync macro-op. */ > -#define IBS_OP_BRANCH_RESYNC(x) ((x->ibs_op_data1_high & BR_MASK_BRN_RESYNC) != 0) > - > -/** 33 op_mispredict_return : mispredicted return macro-op. */ > -#define IBS_OP_MISPREDICT_RETURN(x) ((x->ibs_op_data1_high & BR_MASK_MISP_RETURN) != 0) > - > -/** 34 IbsOpReturn: return macro-op. */ > -#define IBS_OP_RETURN(x) ((x->ibs_op_data1_high & BR_MASK_RETURN) != 0) > - > -/** 35 IbsOpBrnTaken: taken branch macro-op. */ > -#define IBS_OP_BRANCH_TAKEN(x) ((x->ibs_op_data1_high & BR_MASK_BRN_TAKEN) != 0) > - > -/** 36 IbsOpBrnMisp: mispredicted branch macro-op. */ > -#define IBS_OP_BRANCH_MISPREDICT(x) ((x->ibs_op_data1_high & BR_MASK_BRN_MISP) != 0) > - > -/** 37 IbsOpBrnRet: branch macro-op retired. */ > -#define IBS_OP_BRANCH_RETIRED(x) ((x->ibs_op_data1_high & BR_MASK_BRN_RET) != 0) > - > -/** 38 IbsRipInvalid: RIP invalid. */ > -#define IBS_OP_RIP_INVALID(x) ((x->ibs_op_data1_high & MASK_RIP_INVALID) != 0) > - > -/** > - * MSRC001_1036 IBS Op Data 2 Register (IbsOpData2) > - * > - * 5 NbIbsReqCacheHitSt: IBS L3 cache state > - */ > -#define IBS_OP_NB_IBS_CACHE_HIT_ST(x) ((x->ibs_op_data2_low & NB_MASK_L3_STATE) != 0) > - > -/** 4 NbIbsReqDstProc: IBS request destination processor */ > -#define IBS_OP_NB_IBS_REQ_DST_PROC(x) ((x->ibs_op_data2_low & NB_MASK_REQ_DST_PROC) != 0) > - > -/** 2:0 NbIbsReqSrc: Northbridge IBS request data source */ > -#define IBS_OP_NB_IBS_REQ_SRC(x) ((unsigned char)(x->ibs_op_data2_low & NB_MASK_REQ_DATA_SRC)) > - > -#define IBS_OP_NB_IBS_REQ_SRC_01(x) (IBS_OP_NB_IBS_REQ_SRC(x) == 0x01) > - > -#define IBS_OP_NB_IBS_REQ_SRC_02(x) (IBS_OP_NB_IBS_REQ_SRC(x) == 0x02) > - > -#define IBS_OP_NB_IBS_REQ_SRC_03(x) (IBS_OP_NB_IBS_REQ_SRC(x) == 0x03) > - > -#define IBS_OP_NB_IBS_REQ_SRC_07(x) (IBS_OP_NB_IBS_REQ_SRC(x) == 0x07) > - > -/** > - * MSRC001_1037 IBS Op Data3 Register > - * > - * Bits 47:32 IbsDcMissLat > - */ > -#define IBS_OP_DC_MISS_LATENCY(x) ((unsigned short)(x->ibs_op_data3_high & 0xffff)) > - > -/** 0 IbsLdOp: Load op */ > -#define IBS_OP_IBS_LD_OP(x) ((x->ibs_op_data3_low & DC_MASK_LOAD_OP) != 0) > - > -/** 1 IbsStOp: Store op */ > -#define IBS_OP_IBS_ST_OP(x) ((x->ibs_op_data3_low & DC_MASK_STORE_OP) != 0) > - > -/** 2 ibs_dc_l1_tlb_miss: Data cache L1TLB miss */ > -#define IBS_OP_IBS_DC_L1_TLB_MISS(x) ((x->ibs_op_data3_low & DC_MASK_L1_TLB_MISS) != 0) > - > -/** 3 ibs_dc_l2_tlb_miss: Data cache L2TLB miss */ > -#define IBS_OP_IBS_DC_L2_TLB_MISS(x) ((x->ibs_op_data3_low & DC_MASK_L2_TLB_MISS) != 0) > - > -/** 4 IbsDcL1tlbHit2M: Data cache L1TLB hit in 2M page */ > -#define IBS_OP_IBS_DC_L1_TLB_HIT_2MB(x) ((x->ibs_op_data3_low & DC_MASK_L1_HIT_2M) != 0) > - > -/** 5 ibs_dc_l1_tlb_hit_1gb: Data cache L1TLB hit in 1G page */ > -#define IBS_OP_IBS_DC_L1_TLB_HIT_1GB(x) ((x->ibs_op_data3_low & DC_MASK_L1_HIT_1G) != 0) > - > -/** 6 ibs_dc_l2_tlb_hit_2mb: Data cache L2TLB hit in 2M page */ > -#define IBS_OP_IBS_DC_L2_TLB_HIT_2MB(x) ((x->ibs_op_data3_low & DC_MASK_L2_HIT_2M) != 0) > - > -/** 7 ibs_dc_miss: Data cache miss */ > -#define IBS_OP_IBS_DC_MISS(x) ((x->ibs_op_data3_low & DC_MASK_DC_MISS) != 0) > - > -/** 8 ibs_dc_miss_acc: Misaligned access */ > -#define IBS_OP_IBS_DC_MISS_ACC(x) ((x->ibs_op_data3_low & DC_MASK_MISALIGN_ACCESS) != 0) > - > -/** 9 ibs_dc_ld_bnk_con: Bank conflict on load operation */ > -#define IBS_OP_IBS_DC_LD_BNK_CON(x) ((x->ibs_op_data3_low & DC_MASK_LD_BANK_CONFLICT) != 0) > - > -/** 10 ibs_dc_st_bnk_con: Bank conflict on store operation */ > -#define IBS_OP_IBS_DC_ST_BNK_CON(x) ((x->ibs_op_data3_low & DC_MASK_ST_BANK_CONFLICT) != 0) > - > -/** 11 ibs_dc_st_to_ld_fwd : Data forwarded from store to load operation */ > -#define IBS_OP_IBS_DC_ST_TO_LD_FWD(x) ((x->ibs_op_data3_low & DC_MASK_ST_TO_LD_FOR) != 0) > - > -/** 12 ibs_dc_st_to_ld_can: Data forwarding from store to load operation cancelled */ > -#define IBS_OP_IBS_DC_ST_TO_LD_CAN(x) ((x->ibs_op_data3_low & DC_MASK_ST_TO_LD_CANCEL) != 0) > - > -/** 13 ibs_dc_wc_mem_acc : WC memory access */ > -#define IBS_OP_IBS_DC_WC_MEM_ACC(x) ((x->ibs_op_data3_low & DC_MASK_WC_MEM_ACCESS) != 0) > - > -/** 14 ibs_dc_uc_mem_acc : UC memory access */ > -#define IBS_OP_IBS_DC_UC_MEM_ACC(x) ((x->ibs_op_data3_low & DC_MASK_UC_MEM_ACCESS) != 0) > - > -/** 15 ibs_locked_op: Locked operation */ > -#define IBS_OP_IBS_LOCKED_OP(x) ((x->ibs_op_data3_low & DC_MASK_LOCKED_OP) != 0) > - > -/** 16 ibs_dc_mab_hit : MAB hit */ > -#define IBS_OP_IBS_DC_MAB_HIT(x) ((x->ibs_op_data3_low & DC_MASK_MAB_HIT) != 0) > - > -/** 17 IbsDcLinAddrValid: Data cache linear address valid */ > -#define IBS_OP_IBS_DC_LIN_ADDR_VALID(x) ((x->ibs_op_data3_low & DC_MASK_LIN_ADDR_VALID) != 0) > - > -/** 18 ibs_dc_phy_addr_valid: Data cache physical address valid */ > -#define IBS_OP_IBS_DC_PHY_ADDR_VALID(x) ((x->ibs_op_data3_low & DC_MASK_PHY_ADDR_VALID) != 0) > - > -/** 19 ibs_dc_l2_tlb_hit_1gb: Data cache L2TLB hit in 1G page */ > -#define IBS_OP_IBS_DC_L2_TLB_HIT_1GB(x) ((x->ibs_op_data3_low & DC_MASK_L2_HIT_1G) != 0) > - > - > -/** > - * Aggregate the IBS derived event. Increase the > - * derived event count by one. > - */ > -#define AGG_IBS_EVENT(EV) opd_log_ibs_event(EV, trans) > - > -/** > - * Aggregate the IBS latency/cycle counts. Increase the > - * derived event count by the specified count value. > - */ > -#define AGG_IBS_COUNT(EV, COUNT) opd_log_ibs_count(EV, trans, COUNT) > - > -#endif /*OPD_IBS_MACRO_H*/ > diff --git a/daemon/opd_ibs_trans.c b/daemon/opd_ibs_trans.c > deleted file mode 100644 > index 8bb3181..0000000 > --- a/daemon/opd_ibs_trans.c > +++ /dev/null > @@ -1,634 +0,0 @@ > -/** > - * @file daemon/opd_ibs_trans.c > - * AMD Instruction Based Sampling (IBS) translation. > - * > - * @remark Copyright 2008 - 2010 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Jason Yeh <[email protected]> > - * @author Paul Drongowski <[email protected]> > - * @author Suravee Suthikulpanit <[email protected]> > - * Copyright (c) 2008 Advanced Micro Devices, Inc. > - */ > - > -#include "opd_ibs.h" > -#include "opd_ibs_macro.h" > -#include "opd_ibs_trans.h" > -#include "opd_trans.h" > -#include "opd_printf.h" > - > -#include <stdlib.h> > -#include <stdio.h> > - > -extern FILE * bta_log; > -extern FILE * memaccess_log; > - > -/* > - * --------------------- FETCH DERIVED FUNCTION > - */ > -void trans_ibs_fetch (struct transient * trans, unsigned int selected_flag) > -{ > - struct ibs_fetch_sample * trans_fetch = ((struct ibs_sample*)(trans->ext))->fetch; > - > - if ((selected_flag) == 0) > - return; > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_ALL) { > - /* IBS all fetch samples (kills + attempts) */ > - AGG_IBS_EVENT(DE_IBS_FETCH_ALL); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_KILLED) { > - /* IBS killed fetches ("case 0") -- All interesting event > - * flags are clear */ > - if (IBS_FETCH_KILLED(trans_fetch)) > - AGG_IBS_EVENT(DE_IBS_FETCH_KILLED); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_ATTEMPTED) { > - /* Any non-killed fetch is an attempted fetch */ > - AGG_IBS_EVENT(DE_IBS_FETCH_ATTEMPTED); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_COMPLETED) { > - if (IBS_FETCH_FETCH_COMPLETION(trans_fetch)) > - /* IBS Fetch Completed */ > - AGG_IBS_EVENT(DE_IBS_FETCH_COMPLETED); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_ABORTED) { > - if (!IBS_FETCH_FETCH_COMPLETION(trans_fetch)) > - /* IBS Fetch Aborted */ > - AGG_IBS_EVENT(DE_IBS_FETCH_ABORTED); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_L1_ITLB_HIT) { > - /* IBS L1 ITLB hit */ > - if (IBS_FETCH_L1_TLB_HIT(trans_fetch)) > - AGG_IBS_EVENT(DE_IBS_L1_ITLB_HIT); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_ITLB_L1M_L2H) { > - /* IBS L1 ITLB miss and L2 ITLB hit */ > - if (IBS_FETCH_ITLB_L1M_L2H(trans_fetch)) > - AGG_IBS_EVENT(DE_IBS_ITLB_L1M_L2H); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_ITLB_L1M_L2M) { > - /* IBS L1 & L2 ITLB miss; complete ITLB miss */ > - if (IBS_FETCH_ITLB_L1M_L2M(trans_fetch)) > - AGG_IBS_EVENT(DE_IBS_ITLB_L1M_L2M); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_IC_MISS) { > - /* IBS instruction cache miss */ > - if (IBS_FETCH_INST_CACHE_MISS(trans_fetch)) > - AGG_IBS_EVENT(DE_IBS_IC_MISS); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_IC_HIT) { > - /* IBS instruction cache hit */ > - if (IBS_FETCH_INST_CACHE_HIT(trans_fetch)) > - AGG_IBS_EVENT(DE_IBS_IC_HIT); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_4K_PAGE) { > - if (IBS_FETCH_PHYS_ADDR_VALID(trans_fetch) > - && IBS_FETCH_TLB_PAGE_SIZE_4K(trans_fetch)) > - AGG_IBS_EVENT(DE_IBS_FETCH_4K_PAGE); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_2M_PAGE) { > - if (IBS_FETCH_PHYS_ADDR_VALID(trans_fetch) > - && IBS_FETCH_TLB_PAGE_SIZE_2M(trans_fetch)) > - AGG_IBS_EVENT(DE_IBS_FETCH_2M_PAGE); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_1G_PAGE) { > - if (IBS_FETCH_PHYS_ADDR_VALID(trans_fetch) > - && IBS_FETCH_TLB_PAGE_SIZE_1G(trans_fetch)) > - AGG_IBS_EVENT(DE_IBS_FETCH_1G_PAGE); > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_XX_PAGE) { > - } > - > - CHECK_FETCH_SELECTED_FLAG(DE_IBS_FETCH_LATENCY) { > - if (IBS_FETCH_FETCH_LATENCY(trans_fetch)) > - AGG_IBS_COUNT(DE_IBS_FETCH_LATENCY, > - IBS_FETCH_FETCH_LATENCY(trans_fetch)); > - } > -} > - > - > -/* > - * --------------------- OP DERIVED FUNCTION > - */ > -void trans_ibs_op (struct transient * trans, unsigned int selected_flag) > -{ > - struct ibs_op_sample * trans_op = ((struct ibs_sample*)(trans->ext))->op; > - > - if ((selected_flag) == 0) > - return; > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_OP_ALL) { > - /* All IBS op samples */ > - AGG_IBS_EVENT(DE_IBS_OP_ALL); > - } > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_OP_TAG_TO_RETIRE) { > - /* Tally retire cycle counts for all sampled macro-ops > - * IBS tag to retire cycles */ > - if (IBS_OP_TAG_TO_RETIRE_CYCLES(trans_op)) > - AGG_IBS_COUNT(DE_IBS_OP_TAG_TO_RETIRE, > - IBS_OP_TAG_TO_RETIRE_CYCLES(trans_op)); > - } > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_OP_COMP_TO_RETIRE) { > - /* IBS completion to retire cycles */ > - if (IBS_OP_COM_TO_RETIRE_CYCLES(trans_op)) > - AGG_IBS_COUNT(DE_IBS_OP_COMP_TO_RETIRE, > - IBS_OP_COM_TO_RETIRE_CYCLES(trans_op)); > - } > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_BRANCH_RETIRED) { > - if (IBS_OP_BRANCH_RETIRED(trans_op)) > - /* IBS Branch retired op */ > - AGG_IBS_EVENT(DE_IBS_BRANCH_RETIRED) ; > - } > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_BRANCH_MISP) { > - if (IBS_OP_BRANCH_RETIRED(trans_op) > - /* Test branch-specific event flags */ > - /* IBS mispredicted Branch op */ > - && IBS_OP_BRANCH_MISPREDICT(trans_op)) > - AGG_IBS_EVENT(DE_IBS_BRANCH_MISP) ; > - } > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_BRANCH_TAKEN) { > - if (IBS_OP_BRANCH_RETIRED(trans_op) > - /* IBS taken Branch op */ > - && IBS_OP_BRANCH_TAKEN(trans_op)) > - AGG_IBS_EVENT(DE_IBS_BRANCH_TAKEN); > - } > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_BRANCH_MISP_TAKEN) { > - if (IBS_OP_BRANCH_RETIRED(trans_op) > - /* IBS mispredicted taken branch op */ > - && IBS_OP_BRANCH_TAKEN(trans_op) > - && IBS_OP_BRANCH_MISPREDICT(trans_op)) > - AGG_IBS_EVENT(DE_IBS_BRANCH_MISP_TAKEN); > - } > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_RETURN) { > - if (IBS_OP_BRANCH_RETIRED(trans_op) > - /* IBS return op */ > - && IBS_OP_RETURN(trans_op)) > - AGG_IBS_EVENT(DE_IBS_RETURN); > - } > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_RETURN_MISP) { > - if (IBS_OP_BRANCH_RETIRED(trans_op) > - /* IBS mispredicted return op */ > - && IBS_OP_RETURN(trans_op) > - && IBS_OP_BRANCH_MISPREDICT(trans_op)) > - AGG_IBS_EVENT(DE_IBS_RETURN_MISP); > - } > - > - CHECK_OP_SELECTED_FLAG(DE_IBS_RESYNC) { > - /* Test for a resync macro-op */ > - if (IBS_OP_BRANCH_RESYNC(trans_op)) > - AGG_IBS_EVENT(DE_IBS_RESYNC); > - } > -} > - > - > -/* > - * --------------------- OP LS DERIVED FUNCTION > - */ > -void trans_ibs_op_ls (struct transient * trans, unsigned int selected_flag) > -{ > - struct ibs_op_sample * trans_op = ((struct ibs_sample*)(trans->ext))->op; > - > - /* Preliminary check */ > - if (!IBS_OP_IBS_LD_OP(trans_op) && !IBS_OP_IBS_ST_OP(trans_op)) > - return; > - > - > - if ((selected_flag) == 0) > - return; > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_ALL_OP) { > - /* Count the number of LS op samples */ > - AGG_IBS_EVENT(DE_IBS_LS_ALL_OP) ; > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_LOAD_OP) { > - if (IBS_OP_IBS_LD_OP(trans_op)) > - /* TALLy an IBS load derived event */ > - AGG_IBS_EVENT(DE_IBS_LS_LOAD_OP) ; > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_STORE_OP) { > - if (IBS_OP_IBS_ST_OP(trans_op)) > - /* Count and handle store operations */ > - AGG_IBS_EVENT(DE_IBS_LS_STORE_OP); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_DTLB_L1H) { > - if (IBS_OP_IBS_DC_LIN_ADDR_VALID(trans_op) > - && !IBS_OP_IBS_DC_L1_TLB_MISS(trans_op)) > - /* L1 DTLB hit -- This is the most frequent case */ > - AGG_IBS_EVENT(DE_IBS_LS_DTLB_L1H); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_DTLB_L1M_L2H) { > - /* l2_translation_size = 1 */ > - if (IBS_OP_IBS_DC_LIN_ADDR_VALID(trans_op) > - && IBS_OP_IBS_DC_L1_TLB_MISS(trans_op) > - && !IBS_OP_IBS_DC_L2_TLB_MISS(trans_op)) > - /* L1 DTLB miss, L2 DTLB hit */ > - AGG_IBS_EVENT(DE_IBS_LS_DTLB_L1M_L2H); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_DTLB_L1M_L2M) { > - if (IBS_OP_IBS_DC_LIN_ADDR_VALID(trans_op) > - && IBS_OP_IBS_DC_L1_TLB_MISS(trans_op) > - && IBS_OP_IBS_DC_L2_TLB_MISS(trans_op)) > - /* L1 DTLB miss, L2 DTLB miss */ > - AGG_IBS_EVENT(DE_IBS_LS_DTLB_L1M_L2M); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_DC_MISS) { > - if (IBS_OP_IBS_DC_MISS(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_DC_MISS); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_DC_HIT) { > - if (!IBS_OP_IBS_DC_MISS(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_DC_HIT); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_MISALIGNED) { > - if (IBS_OP_IBS_DC_MISS_ACC(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_MISALIGNED); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_BNK_CONF_LOAD) { > - if (IBS_OP_IBS_DC_LD_BNK_CON(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_BNK_CONF_LOAD); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_BNK_CONF_STORE) { > - if (IBS_OP_IBS_DC_ST_BNK_CON(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_BNK_CONF_STORE); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_STL_FORWARDED) { > - if (IBS_OP_IBS_LD_OP(trans_op) > - /* Data forwarding info are valid only for load ops */ > - && IBS_OP_IBS_DC_ST_TO_LD_FWD(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_STL_FORWARDED) ; > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_STL_CANCELLED) { > - if (IBS_OP_IBS_LD_OP(trans_op)) > - if (IBS_OP_IBS_DC_ST_TO_LD_CAN(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_STL_CANCELLED) ; > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_UC_MEM_ACCESS) { > - if (IBS_OP_IBS_DC_UC_MEM_ACC(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_UC_MEM_ACCESS); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_WC_MEM_ACCESS) { > - if (IBS_OP_IBS_DC_WC_MEM_ACC(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_WC_MEM_ACCESS); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_LOCKED_OP) { > - if (IBS_OP_IBS_LOCKED_OP(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_LOCKED_OP); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_MAB_HIT) { > - if (IBS_OP_IBS_DC_MAB_HIT(trans_op)) > - AGG_IBS_EVENT(DE_IBS_LS_MAB_HIT); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_L1_DTLB_4K) { > - /* l1_translation */ > - if (IBS_OP_IBS_DC_LIN_ADDR_VALID(trans_op) > - && !IBS_OP_IBS_DC_L1_TLB_MISS(trans_op) > - > - && !IBS_OP_IBS_DC_L1_TLB_HIT_2MB(trans_op) > - && !IBS_OP_IBS_DC_L1_TLB_HIT_1GB(trans_op)) > - /* This is the most common case, unfortunately */ > - AGG_IBS_EVENT(DE_IBS_LS_L1_DTLB_4K) ; > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_L1_DTLB_2M) { > - /* l1_translation */ > - if (IBS_OP_IBS_DC_LIN_ADDR_VALID(trans_op) > - && !IBS_OP_IBS_DC_L1_TLB_MISS(trans_op) > - > - && IBS_OP_IBS_DC_L1_TLB_HIT_2MB(trans_op)) > - /* 2M L1 DTLB page translation */ > - AGG_IBS_EVENT(DE_IBS_LS_L1_DTLB_2M); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_L1_DTLB_1G) { > - /* l1_translation */ > - if (IBS_OP_IBS_DC_LIN_ADDR_VALID(trans_op) > - && !IBS_OP_IBS_DC_L1_TLB_MISS(trans_op) > - > - && !IBS_OP_IBS_DC_L1_TLB_HIT_2MB(trans_op) > - && IBS_OP_IBS_DC_L1_TLB_HIT_1GB(trans_op)) > - /* 1G L1 DTLB page translation */ > - AGG_IBS_EVENT(DE_IBS_LS_L1_DTLB_1G); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_L1_DTLB_RES) { > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_L2_DTLB_4K) { > - /* l2_translation_size = 1 */ > - if (IBS_OP_IBS_DC_LIN_ADDR_VALID(trans_op) > - && IBS_OP_IBS_DC_L1_TLB_MISS(trans_op) > - && !IBS_OP_IBS_DC_L2_TLB_MISS(trans_op) > - > - /* L2 DTLB page translation */ > - && !IBS_OP_IBS_DC_L2_TLB_HIT_2MB(trans_op) > - && !IBS_OP_IBS_DC_L2_TLB_HIT_1GB(trans_op)) > - /* 4K L2 DTLB page translation */ > - AGG_IBS_EVENT(DE_IBS_LS_L2_DTLB_4K); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_L2_DTLB_2M) { > - /* l2_translation_size = 1 */ > - if (IBS_OP_IBS_DC_LIN_ADDR_VALID(trans_op) > - && IBS_OP_IBS_DC_L1_TLB_MISS(trans_op) > - && !IBS_OP_IBS_DC_L2_TLB_MISS(trans_op) > - > - /* L2 DTLB page translation */ > - && IBS_OP_IBS_DC_L2_TLB_HIT_2MB(trans_op) > - && !IBS_OP_IBS_DC_L2_TLB_HIT_1GB(trans_op)) > - /* 2M L2 DTLB page translation */ > - AGG_IBS_EVENT(DE_IBS_LS_L2_DTLB_2M); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_L2_DTLB_1G) { > - /* l2_translation_size = 1 */ > - if (IBS_OP_IBS_DC_LIN_ADDR_VALID(trans_op) > - && IBS_OP_IBS_DC_L1_TLB_MISS(trans_op) > - && !IBS_OP_IBS_DC_L2_TLB_MISS(trans_op) > - > - /* L2 DTLB page translation */ > - && !IBS_OP_IBS_DC_L2_TLB_HIT_2MB(trans_op) > - && IBS_OP_IBS_DC_L2_TLB_HIT_1GB(trans_op)) > - /* 2M L2 DTLB page translation */ > - AGG_IBS_EVENT(DE_IBS_LS_L2_DTLB_1G); > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_L2_DTLB_RES2) { > - } > - > - CHECK_OP_LS_SELECTED_FLAG(DE_IBS_LS_DC_LOAD_LAT) { > - if (IBS_OP_IBS_LD_OP(trans_op) > - /* If the load missed in DC, tally the DC load miss latency */ > - && IBS_OP_IBS_DC_MISS(trans_op)) > - /* DC load miss latency is only reliable for load ops */ > - AGG_IBS_COUNT(DE_IBS_LS_DC_LOAD_LAT, > - IBS_OP_DC_MISS_LATENCY(trans_op)) ; > - } > -} > - > -/* > - * --------------------- OP NB DERIVED FUNCTION > - * > - * NB data is only guaranteed reliable for load operations > - * that miss in L1 and L2 cache. NB data arrives too late > - * to be reliable for store operations > - */ > -void trans_ibs_op_nb (struct transient * trans, unsigned int selected_flag) > -{ > - struct ibs_op_sample * trans_op = ((struct ibs_sample*)(trans->ext))->op; > - > - /* Preliminary check */ > - if ((selected_flag) == 0) > - return; > - > - if (!IBS_OP_IBS_LD_OP(trans_op)) > - return; > - > - if (!IBS_OP_IBS_DC_MISS(trans_op)) > - return; > - > - if (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0) > - return; > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL) { > - if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) > - /* Request was serviced by local processor */ > - AGG_IBS_EVENT(DE_IBS_NB_LOCAL) ; > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE) { > - if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) > - /* Request was serviced by remote processor */ > - AGG_IBS_EVENT(DE_IBS_NB_REMOTE) ; > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_L3) { > - if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) > - && IBS_OP_NB_IBS_REQ_SRC_01(trans_op)) > - AGG_IBS_EVENT(DE_IBS_NB_LOCAL_L3); > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_CACHE) { > - if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) > - && IBS_OP_NB_IBS_REQ_SRC_02(trans_op)) > - AGG_IBS_EVENT(DE_IBS_NB_LOCAL_CACHE); > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE_CACHE) { > - if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) > - && IBS_OP_NB_IBS_REQ_SRC_02(trans_op)) > - AGG_IBS_EVENT(DE_IBS_NB_REMOTE_CACHE) ; > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_DRAM) { > - if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) > - && IBS_OP_NB_IBS_REQ_SRC_03(trans_op)) > - AGG_IBS_EVENT(DE_IBS_NB_LOCAL_DRAM); > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE_DRAM) { > - if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) > - && IBS_OP_NB_IBS_REQ_SRC_03(trans_op)) > - AGG_IBS_EVENT(DE_IBS_NB_REMOTE_DRAM) ; > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_OTHER) { > - if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) > - && IBS_OP_NB_IBS_REQ_SRC_07(trans_op)) > - AGG_IBS_EVENT(DE_IBS_NB_LOCAL_OTHER); > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE_OTHER) { > - if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) > - && IBS_OP_NB_IBS_REQ_SRC_07(trans_op)) > - AGG_IBS_EVENT(DE_IBS_NB_REMOTE_OTHER) ; > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_CACHE_STATE_M) { > - if (IBS_OP_NB_IBS_REQ_SRC_02(trans_op) > - && !IBS_OP_NB_IBS_CACHE_HIT_ST(trans_op)) > - AGG_IBS_EVENT(DE_IBS_NB_CACHE_STATE_M) ; > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_CACHE_STATE_O) { > - if (IBS_OP_NB_IBS_REQ_SRC_02(trans_op) > - && IBS_OP_NB_IBS_CACHE_HIT_ST(trans_op)) > - AGG_IBS_EVENT(DE_IBS_NB_CACHE_STATE_O) ; > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_LATENCY) { > - if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) > - /* Request was serviced by local processor */ > - AGG_IBS_COUNT(DE_IBS_NB_LOCAL_LATENCY, > - IBS_OP_DC_MISS_LATENCY(trans_op)); > - } > - > - CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE_LATENCY) { > - if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) > - /* Request was serviced by remote processor */ > - AGG_IBS_COUNT(DE_IBS_NB_REMOTE_LATENCY, > - IBS_OP_DC_MISS_LATENCY(trans_op)); > - } > -} > - > - > -int trans_ibs_op_rip_invalid (struct transient * trans) > -{ > - struct ibs_op_sample * trans_op = ((struct ibs_sample*)(trans->ext))->op; > - > - if (IBS_OP_RIP_INVALID(trans_op)) > - return 1; > - > - return 0; > -} > - > - > -void trans_ibs_op_mask_reserved (unsigned int family, struct transient * trans) > -{ > - struct ibs_op_sample * trans_op = ((struct ibs_sample*)(trans->ext))->op; > - > - switch (family) { > - case 0x10: > - /* Reserved IbsRipInvalid (MSRC001_1035[38])*/ > - trans_op->ibs_op_data1_high &= ~MASK_RIP_INVALID; > - break; > - case 0x12: > - /* Reserved NbIbsReqDstProc (MSRCC001_1036[4]) */ > - trans_op->ibs_op_data2_low &= ~NB_MASK_REQ_DST_PROC; > - /* Reserved NbIbsReqCacheHitSt (MSRCC001_1036[5]) */ > - trans_op->ibs_op_data2_low &= ~NB_MASK_L3_STATE; > - break; > - case 0x14: > - /* Reserved NbIbsReqDstProc (MSRCC001_1036[4]) */ > - trans_op->ibs_op_data2_low &= ~NB_MASK_REQ_DST_PROC; > - /* Reserved NbIbsReqCacheHitSt (MSRCC001_1036[5]) */ > - trans_op->ibs_op_data2_low &= ~NB_MASK_L3_STATE; > - /* Reserved IbsDcL1tlbHit1G (MSRC001_1037[5]) */ > - trans_op->ibs_op_data3_low &= ~DC_MASK_L1_HIT_1G; > - /* Reserved IbsDcLdBnkCon (MSRC001_1037[9]) */ > - trans_op->ibs_op_data3_low &= ~DC_MASK_LD_BANK_CONFLICT; > - /* Reserved IbsDcStBnkCon (MSRC001_1037[10]) */ > - trans_op->ibs_op_data3_low &= ~DC_MASK_ST_BANK_CONFLICT; > - /* Reserved IbsDcStToLdCan (MSRC001_1037[12]) */ > - trans_op->ibs_op_data3_low &= ~DC_MASK_ST_TO_LD_CANCEL; > - /* Reserved IbsDcL2tlbHit1G (MSRC001_1037[19]) */ > - trans_op->ibs_op_data3_low &= ~DC_MASK_L2_HIT_1G; > - > - break; > - case 0x15: > - default: > - break; > - > - } > -} > - > - > -void trans_ibs_op_bta(struct transient * trans) > -{ > - static cookie_t old_cookie = NO_COOKIE; > - static cookie_t old_app_cookie = NO_COOKIE; > - struct ibs_op_sample * trans_op = ((struct ibs_sample*)(trans->ext))->op; > - > - if (!bta_log) > - return; > - > - if (!trans_op->ibs_op_brtgt_addr) > - return; > - > - if( old_app_cookie == INVALID_COOKIE > - || old_app_cookie == NO_COOKIE > - || old_app_cookie != trans->app_cookie) { > - old_app_cookie = trans->cookie; > - } > - > - if (trans->in_kernel == 1) { > - old_cookie = NO_COOKIE; > - } else { > - if( old_cookie == INVALID_COOKIE > - || old_cookie == NO_COOKIE > - || old_cookie != trans->cookie) { > - old_cookie = trans->cookie; > - } > - } > - > - fprintf(bta_log, "0x%016llx,0x%016llx,%02lu %08u,%08u,0x%08x,0x%08lx\n", > - trans->app_cookie, trans->cookie, trans->cpu, trans->tgid, trans->tid, (unsigned int)trans->pc, > - trans_op->ibs_op_brtgt_addr); > -} > - > - > -void trans_ibs_op_ls_memaccess(struct transient * trans) > -{ > - static cookie_t old_cookie = NO_COOKIE; > - static cookie_t old_app_cookie = NO_COOKIE; > - struct ibs_op_sample * trans_op = ((struct ibs_sample*)(trans->ext))->op; > - > - if (!memaccess_log) > - return; > - > - if( old_app_cookie == INVALID_COOKIE > - || old_app_cookie == NO_COOKIE > - || old_app_cookie != trans->app_cookie) { > - old_app_cookie = trans->cookie; > - } > - > - if (trans->in_kernel == 1) { > - old_cookie = NO_COOKIE; > - } else { > - if( old_cookie == INVALID_COOKIE > - || old_cookie == NO_COOKIE > - || old_cookie != trans->cookie) { > - old_cookie = trans->cookie; > - } > - } > - > - fprintf(memaccess_log, "0x%016llx,0x%016llx,%02lu,%08u,%08u,0x%08x,0x%08u:%08x,0x%08x:%08x,%s,%08u\n", > - trans->app_cookie, > -trans->cookie, > -trans->cpu, > -trans->tgid, > -trans->tid, > -(unsigned int)trans->pc, > - trans_op->ibs_op_phys_addr_high, trans_op->ibs_op_phys_addr_low, > - trans_op->ibs_op_ldst_linaddr_high, trans_op->ibs_op_ldst_linaddr_low, > - (IBS_OP_IBS_LD_OP(trans_op))? "LD": "ST", > - (unsigned int) IBS_OP_DC_MISS_LATENCY(trans_op)); > -} > diff --git a/daemon/opd_ibs_trans.h b/daemon/opd_ibs_trans.h > deleted file mode 100644 > index bf34dfa..0000000 > --- a/daemon/opd_ibs_trans.h > +++ /dev/null > @@ -1,35 +0,0 @@ > -/** > - * @file daemon/opd_ibs_trans.h > - * AMD Family10h Instruction Based Sampling (IBS) translation. > - * > - * @remark Copyright 2008 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Jason Yeh <[email protected]> > - * @author Paul Drongowski <[email protected]> > - * @author Suravee Suthikulpanit <[email protected]> > - * Copyright (c) 2008 Advanced Micro Devices, Inc. > - */ > - > -#ifndef OPD_IBS_TRANS_H > -#define OPD_IBS_TRANS_H > - > -struct ibs_fetch_sample; > -struct ibs_op_sample; > -struct transient; > - > -struct ibs_translation_table { > - unsigned int event; > - void (*translator)(struct transient *); > -}; > - > - > -extern void trans_ibs_fetch (struct transient * trans, unsigned int selected_flag); > -extern void trans_ibs_op (struct transient * trans, unsigned int selected_flag); > -extern void trans_ibs_op_ls (struct transient * trans, unsigned int selected_flag); > -extern void trans_ibs_op_nb (struct transient * trans, unsigned int selected_flag); > -extern int trans_ibs_op_rip_invalid (struct transient * trans); > -extern void trans_ibs_op_mask_reserved (unsigned int family, struct transient * trans); > -extern void trans_ibs_op_ls_memaccess(struct transient * trans); > -extern void trans_ibs_op_bta (struct transient * trans); > -#endif // OPD_IBS_TRANS_H > diff --git a/daemon/opd_interface.h b/daemon/opd_interface.h > deleted file mode 100644 > index ef3b02c..0000000 > --- a/daemon/opd_interface.h > +++ /dev/null > @@ -1,48 +0,0 @@ > -/** > - * @file opd_interface.h > - * > - * Module / user space interface for 2.6 kernels and above > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - * Modified by Aravind Menon for Xen > - * These modifications are: > - * Copyright (C) 2005 Hewlett-Packard Co. > - */ > - > -#ifndef OPD_INTERFACE_H > -#define OPD_INTERFACE_H > - > -#define CTX_SWITCH_CODE 1 > -#define CPU_SWITCH_CODE 2 > -#define COOKIE_SWITCH_CODE 3 > -#define KERNEL_ENTER_SWITCH_CODE 4 > -#define USER_ENTER_SWITCH_CODE 5 > -#define MODULE_LOADED_CODE 6 > -#define CTX_TGID_CODE 7 > -#define TRACE_BEGIN_CODE 8 > -/* Code 9 used to be TRACE_END_CODE which is not used anymore */ > -/* Code 9 is now considered an unknown escape code */ > -#define XEN_ENTER_SWITCH_CODE 10 > -/* > - * Ugly work-around for the unfortunate collision between Xenoprof's > - * DOMAIN_SWITCH_CODE (in use on x86) and Cell's SPU_PROFILING_CODE > - * (in use with Power): > - */ > -#if defined(__powerpc__) > -#define SPU_PROFILING_CODE 11 > -#define SPU_CTX_SWITCH_CODE 12 > -#else > -#define DOMAIN_SWITCH_CODE 11 > -/* Code 12 is now considered an unknown escape code */ > -#endif > - > -/* AMD's Instruction-Based Sampling (IBS) escape code */ > -#define IBS_FETCH_SAMPLE 13 > -#define IBS_OP_SAMPLE 14 > -#define LAST_CODE 15 > - > -#endif /* OPD_INTERFACE_H */ > diff --git a/daemon/opd_kernel.c b/daemon/opd_kernel.c > deleted file mode 100644 > index 5ebc210..0000000 > --- a/daemon/opd_kernel.c > +++ /dev/null > @@ -1,229 +0,0 @@ > -/** > - * @file daemon/opd_kernel.c > - * Dealing with the kernel and kernel module samples > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - * Modified by Aravind Menon for Xen > - * These modifications are: > - * Copyright (C) 2005 Hewlett-Packard Co. > - */ > - > -#include "opd_kernel.h" > -#include "opd_sfile.h" > -#include "opd_trans.h" > -#include "opd_printf.h" > -#include "opd_stats.h" > -#include "oprofiled.h" > - > -#include "op_fileio.h" > -#include "op_config.h" > -#include "op_libiberty.h" > - > -#include <string.h> > -#include <stdlib.h> > -#include <errno.h> > -#include <assert.h> > - > -static LIST_HEAD(modules); > - > -static struct kernel_image vmlinux_image; > - > -static struct kernel_image xen_image; > - > -void opd_create_vmlinux(char const * name, char const * arg) > -{ > - /* vmlinux is *not* on the list of modules */ > - list_init(&vmlinux_image.list); > - > - /* for no vmlinux */ > - if (no_vmlinux) { > - vmlinux_image.name = "no-vmlinux"; > - return; > - } > - > - vmlinux_image.name = xstrdup(name); > - > - sscanf(arg, "%llx,%llx", &vmlinux_image.start, &vmlinux_image.end); > - > - verbprintf(vmisc, "kernel_start = %llx, kernel_end = %llx\n", > - vmlinux_image.start, vmlinux_image.end); > - > - if (!vmlinux_image.start && !vmlinux_image.end) { > - fprintf(stderr, "error: mis-parsed kernel range: %llx-%llx\n", > - vmlinux_image.start, vmlinux_image.end); > - exit(EXIT_FAILURE); > - } > -} > - > -void opd_create_xen(char const * name, char const * arg) > -{ > - /* xen is *not* on the list of modules */ > - list_init(&xen_image.list); > - > - /* for no xen */ > - if (no_xen) { > - xen_image.name = "no-xen"; > - return; > - } > - > - xen_image.name = xstrdup(name); > - > - sscanf(arg, "%llx,%llx", &xen_image.start, &xen_image.end); > - > - verbprintf(vmisc, "xen_start = %llx, xen_end = %llx\n", > - xen_image.start, xen_image.end); > - > - if (!xen_image.start && !xen_image.end) { > - fprintf(stderr, "error: mis-parsed xen range: %llx-%llx\n", > - xen_image.start, xen_image.end); > - exit(EXIT_FAILURE); > - } > -} > - > - > -/** > - * Allocate and initialise a kernel image description > - * @param name image name > - * @param start start address > - * @param end end address > - */ > -static struct kernel_image * > -opd_create_module(char const * name, vma_t start, vma_t end) > -{ > - struct kernel_image * image = xmalloc(sizeof(struct kernel_image)); > - > - image->name = xstrdup(name); > - image->start = start; > - image->end = end; > - list_add(&image->list, &modules); > - > - return image; > -} > - > - > -/** > - * Clear and free all kernel image information and reset > - * values. > - */ > -static void opd_clear_modules(void) > -{ > - struct list_head * pos; > - struct list_head * pos2; > - struct kernel_image * image; > - > - list_for_each_safe(pos, pos2, &modules) { > - image = list_entry(pos, struct kernel_image, list); > - if (image->name) > - free(image->name); > - free(image); > - } > - > - list_init(&modules); > - > - /* clear out lingering references */ > - sfile_clear_kernel(); > -} > - > - > -/* > - * each line is in the format: > - * > - * module_name 16480 1 dependencies Live 0xe091e000 > - * > - * without any blank space in each field > - */ > -void opd_reread_module_info(void) > -{ > - FILE * fp; > - char * line; > - struct kernel_image * image; > - int module_size; > - char ref_count[32+1]; > - int ret; > - char module_name[256+1]; > - char live_info[32+1]; > - char dependencies[4096+1]; > - unsigned long long start_address; > - > - if (no_vmlinux) > - return; > - > - opd_clear_modules(); > - > - printf("Reading module info.\n"); > - > - fp = op_try_open_file("/proc/modules", "r"); > - > - if (!fp) { > - printf("oprofiled: /proc/modules not readable, " > - "can't process module samples.\n"); > - return; > - } > - > - while (1) { > - line = op_get_line(fp); > - > - if (!line) > - break; > - > - if (line[0] == '\0') { > - free(line); > - continue; > - } > - > - ret = sscanf(line, "%256s %u %32s %4096s %32s %llx", > - module_name, &module_size, ref_count, > - dependencies, live_info, &start_address); > - if (ret != 6) { > - printf("bad /proc/modules entry: %s\n", line); > - free(line); > - continue; > - } > - > - image = opd_create_module(module_name, start_address, > - start_address + module_size); > - > - verbprintf(vmodule, "module %s start %llx end %llx\n", > - image->name, image->start, image->end); > - > - free(line); > - } > - > - op_close_file(fp); > -} > - > - > -/** > - * find a kernel image by PC value > - * @param trans holds PC value to look up > - * > - * find the kernel image which contains this PC. > - * > - * Return %NULL if not found. > - */ > -struct kernel_image * find_kernel_image(struct transient const * trans) > -{ > - struct list_head * pos; > - struct kernel_image * image = &vmlinux_image; > - > - if (no_vmlinux) > - return image; > - > - if (image->start <= trans->pc && image->end > trans->pc) > - return image; > - > - list_for_each(pos, &modules) { > - image = list_entry(pos, struct kernel_image, list); > - if (image->start <= trans->pc && image->end > trans->pc) > - return image; > - } > - > - if (xen_image.start <= trans->pc && xen_image.end > trans->pc) > - return &xen_image; > - > - return NULL; > -} > diff --git a/daemon/opd_kernel.h b/daemon/opd_kernel.h > deleted file mode 100644 > index cb71a30..0000000 > --- a/daemon/opd_kernel.h > +++ /dev/null > @@ -1,43 +0,0 @@ > -/** > - * @file daemon/opd_kernel.h > - * Dealing with the kernel and kernel module images > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - * Modified by Aravind Menon for Xen > - * These modifications are: > - * Copyright (C) 2005 Hewlett-Packard Co. > - */ > - > -#ifndef OPD_KERNEL_H > -#define OPD_KERNEL_H > - > -#include "op_types.h" > -#include "op_list.h" > - > -struct transient; > - > -/** create the kernel image */ > -void opd_create_vmlinux(char const * name, char const * arg); > - > -void opd_create_xen(char const * name, char const * arg); > - > -/** opd_reread_module_info - parse /proc/modules for kernel modules */ > -void opd_reread_module_info(void); > - > -/** Describes a kernel module or vmlinux itself */ > -struct kernel_image { > - char * name; > - vma_t start; > - vma_t end; > - struct list_head list; > -}; > - > -/** Find a kernel_image based upon the given parameters in trans. */ > -struct kernel_image * > -find_kernel_image(struct transient const * trans); > - > -#endif /* OPD_KERNEL_H */ > diff --git a/daemon/opd_mangling.c b/daemon/opd_mangling.c > deleted file mode 100644 > index 9d14dc4..0000000 > --- a/daemon/opd_mangling.c > +++ /dev/null > @@ -1,213 +0,0 @@ > -/** > - * @file daemon/opd_mangling.c > - * Mangling and opening of sample files > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#include <sys/types.h> > - > -#include "opd_mangling.h" > -#include "opd_kernel.h" > -#include "opd_cookie.h" > -#include "opd_sfile.h" > -#include "opd_anon.h" > -#include "opd_printf.h" > -#include "opd_events.h" > -#include "oprofiled.h" > - > -#include "op_file.h" > -#include "op_sample_file.h" > -#include "op_config.h" > -#include "op_mangle.h" > -#include "op_events.h" > -#include "op_libiberty.h" > - > -#include <limits.h> > -#include <stdio.h> > -#include <stdlib.h> > -#include <string.h> > -#include <errno.h> > - > - > -static char const * get_dep_name(struct sfile const * sf) > -{ > - if (sf->anon) > - return find_cookie(sf->app_cookie); > - > - /* avoid to call find_cookie(), caller can recover using image_name */ > - if (sf->cookie == sf->app_cookie) > - return NULL; > - > - if (!separate_kernel && !(separate_lib && !sf->kernel)) > - return NULL; > - > - /* this will fail if e.g. kernel thread */ > - if (sf->app_cookie == 0) > - return NULL; > - > - return find_cookie(sf->app_cookie); > -} > - > - > -static char * mangle_anon(struct anon_mapping const * anon) > -{ > - char * name = xmalloc(PATH_MAX); > - > - snprintf(name, 1024, "%u.0x%llx.0x%llx", (unsigned int)anon->tgid, > - anon->start, anon->end); > - > - return name; > -} > - > - > -static char * > -mangle_filename(struct sfile * last, struct sfile const * sf, int counter, int cg) > -{ > - char * mangled; > - struct mangle_values values; > - struct opd_event * event = find_counter_event(counter); > - > - values.flags = 0; > - > - // To silence Coverity > - values.anon_name = NULL; > - values.cg_image_name = NULL; > - if (sf->kernel) { > - values.image_name = sf->kernel->name; > - values.flags |= MANGLE_KERNEL; > - } else if (sf->anon) { > - values.flags |= MANGLE_ANON; > - values.image_name = mangle_anon(sf->anon); > - values.anon_name = sf->anon->name; > - } else { > - values.image_name = find_cookie(sf->cookie); > - } > - > - values.dep_name = get_dep_name(sf); > - if (!values.dep_name) > - values.dep_name = values.image_name; > - > - /* FIXME: log */ > - if (!values.image_name || !values.dep_name) > - return NULL; > - > - if (separate_thread) { > - values.flags |= MANGLE_TGID | MANGLE_TID; > - values.tid = sf->tid; > - values.tgid = sf->tgid; > - } > - > - if (separate_cpu) { > - values.flags |= MANGLE_CPU; > - values.cpu = sf->cpu; > - } > - > - if (cg) { > - values.flags |= MANGLE_CALLGRAPH; > - if (last->kernel) { > - values.cg_image_name = last->kernel->name; > - } else if (last->anon) { > - values.flags |= MANGLE_CG_ANON; > - values.cg_image_name = mangle_anon(last->anon); > - values.anon_name = last->anon->name; > - } else { > - values.cg_image_name = find_cookie(last->cookie); > - } > - > - /* FIXME: log */ > - if (!values.cg_image_name) { > - if (values.flags & MANGLE_ANON) > - free((char *)values.image_name); > - return NULL; > - } > - } > - > - values.event_name = event->name; > - values.count = event->count; > - values.unit_mask = event->um; > - > - mangled = op_mangle_filename(&values); > - > - if (values.flags & MANGLE_ANON) > - free((char *)values.image_name); > - if (values.flags & MANGLE_CG_ANON) > - free((char *)values.cg_image_name); > - return mangled; > -} > - > - > -int opd_open_sample_file(odb_t *file, struct sfile *last, > - struct sfile * sf, int counter, int cg) > -{ > - char * mangled; > - char const * binary; > - int spu_profile = 0; > - vma_t last_start = 0; > - int err; > - > - mangled = mangle_filename(last, sf, counter, cg); > - > - if (!mangled) > - return EINVAL; > - > - verbprintf(vsfile, "Opening \"%s\"\n", mangled); > - > - err = create_path(mangled); > - if (err) { > - fprintf(stderr, "oprofiled: create path for %s failed: %s\n", > - mangled, strerror(err)); > - goto out; > - } > - > - /* locking sf will lock associated cg files too */ > - sfile_get(sf); > - if (sf != last) > - sfile_get(last); > - > -retry: > - err = odb_open(file, mangled, ODB_RDWR, sizeof(struct opd_header)); > - > - /* This can naturally happen when racing against opcontrol --reset. */ > - if (err) { > - if (err == EMFILE) { > - if (sfile_lru_clear()) { > - printf("LRU cleared but odb_open() fails for %s.\n", mangled); > - abort(); > - } > - goto retry; > - } > - > - fprintf(stderr, "oprofiled: open of %s failed: %s\n", > - mangled, strerror(err)); > - goto out; > - } > - > - if (!sf->kernel) > - binary = find_cookie(sf->cookie); > - else > - binary = sf->kernel->name; > - > - if (last && last->anon) > - last_start = last->anon->start; > - > - if (sf->embedded_offset != UNUSED_EMBEDDED_OFFSET) > - spu_profile = 1; > - > - fill_header(odb_get_data(file), counter, > - sf->anon ? sf->anon->start : 0, last_start, > - !!sf->kernel, last ? !!last->kernel : 0, > - spu_profile, sf->embedded_offset, > - binary ? op_get_mtime(binary) : 0); > - > -out: > - sfile_put(sf); > - if (sf != last) > - sfile_put(last); > - free(mangled); > - return err; > -} > diff --git a/daemon/opd_mangling.h b/daemon/opd_mangling.h > deleted file mode 100644 > index d1b2a78..0000000 > --- a/daemon/opd_mangling.h > +++ /dev/null > @@ -1,33 +0,0 @@ > -/** > - * @file daemon/opd_mangling.h > - * Mangling and opening of sample files > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#ifndef OPD_MANGLING_H > -#define OPD_MANGLING_H > - > -#include "odb.h" > - > -struct sfile; > - > -/* > - * opd_open_sample_file - open a sample file > - * @param sf sfile to open sample file for > - * @param counter counter number > - * @param cg if this is a callgraph file > - * > - * Open image sample file for the sfile, counter > - * counter and set up memory mappings for it. > - * > - * Returns 0 on success. > - */ > -int opd_open_sample_file(odb_t *file, struct sfile *last, > - struct sfile * sf, int counter, int cg); > - > -#endif /* OPD_MANGLING_H */ > diff --git a/daemon/opd_perfmon.c b/daemon/opd_perfmon.c > deleted file mode 100644 > index 97f307c..0000000 > --- a/daemon/opd_perfmon.c > +++ /dev/null > @@ -1,522 +0,0 @@ > -/** > - * @file opd_perfmon.c > - * perfmonctl() handling > - * > - * @remark Copyright 2003 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - */ > - > -#ifdef __ia64__ > - > -/* need this for sched_setaffinity() in <sched.h> */ > -#define _GNU_SOURCE > - > -#include "oprofiled.h" > -#include "opd_perfmon.h" > -#include "opd_events.h" > - > -#include "op_cpu_type.h" > -#include "op_libiberty.h" > -#include "op_hw_config.h" > - > -#include <sys/syscall.h> > -#include <sys/wait.h> > -#include <unistd.h> > -#include <limits.h> > -#include <signal.h> > -#include <stdio.h> > -#include <stdlib.h> > -#include <string.h> > -#include <errno.h> > -#include <sys/types.h> > -#include <sys/stat.h> > -#ifdef HAVE_SCHED_SETAFFINITY > -#include <sched.h> > -#endif > - > -extern op_cpu cpu_type; > - > -#ifndef HAVE_SCHED_SETAFFINITY > - > -/* many glibc's are not yet up to date */ > -#ifndef __NR_sched_setaffinity > -#define __NR_sched_setaffinity 1231 > -#endif > - > -/* Copied from glibc's <sched.h> and <bits/sched.h> and munged */ > -#define CPU_SETSIZE 1024 > -#define __NCPUBITS (8 * sizeof (unsigned long)) > -typedef struct > -{ > - unsigned long __bits[CPU_SETSIZE / __NCPUBITS]; > -} cpu_set_t; > - > -#define CPU_SET(cpu, cpusetp) \ > - ((cpusetp)->__bits[(cpu)/__NCPUBITS] |= (1UL << ((cpu) % __NCPUBITS))) > -#define CPU_ZERO(cpusetp) \ > - memset((cpusetp), 0, sizeof(cpu_set_t)) > - > -static int > -sched_setaffinity(pid_t pid, size_t len, cpu_set_t const * cpusetp) > -{ > - return syscall(__NR_sched_setaffinity, pid, len, cpusetp); > -} > -#endif > - > - > -#ifndef HAVE_PERFMONCTL > -#ifndef __NR_perfmonctl > -#define __NR_perfmonctl 1175 > -#endif > - > -static int perfmonctl(int fd, int cmd, void * arg, int narg) > -{ > - return syscall(__NR_perfmonctl, fd, cmd, arg, narg); > -} > -#endif > - > - > -static unsigned char uuid[16] = { > - 0x77, 0x7a, 0x6e, 0x61, 0x20, 0x65, 0x73, 0x69, > - 0x74, 0x6e, 0x72, 0x20, 0x61, 0x65, 0x0a, 0x6c > -}; > - > - > -static size_t nr_cpus; > - > -struct child { > - pid_t pid; > - int up_pipe[2]; > - int ctx_fd; > - sig_atomic_t sigusr1; > - sig_atomic_t sigusr2; > - sig_atomic_t sigterm; > -}; > - > -static struct child * children; > - > -static void perfmon_start_child(int ctx_fd) > -{ > - if (perfmonctl(ctx_fd, PFM_START, 0, 0) == -1) { > - exit(EXIT_FAILURE); > - } > -} > - > - > -static void perfmon_stop_child(int ctx_fd) > -{ > - if (perfmonctl(ctx_fd, PFM_STOP, 0, 0) == -1) { > - exit(EXIT_FAILURE); > - } > -} > - > - > -static void child_sigusr1(int val __attribute__((unused))) > -{ > - size_t i; > - > - for (i = 0; i < nr_cpus; ++i) { > - if (children[i].pid == getpid()) { > - children[i].sigusr1 = 1; > - return; > - } > - } > -} > - > - > -static void child_sigusr2(int val __attribute__((unused))) > -{ > - size_t i; > - > - for (i = 0; i < nr_cpus; ++i) { > - if (children[i].pid == getpid()) { > - children[i].sigusr2 = 1; > - return; > - } > - } > -} > - > - > -static void child_sigterm(int val __attribute__((unused))) > -{ > - kill(getppid(), SIGTERM); > -} > - > - > -static void set_affinity(size_t cpu) > -{ > - cpu_set_t set; > - int err; > - > - CPU_ZERO(&set); > - CPU_SET(cpu, &set); > - > - err = sched_setaffinity(getpid(), sizeof(set), &set); > - > - if (err == -1) { > - perror("Failed to set affinity"); > - exit(EXIT_FAILURE); > - } > -} > - > - > -static void setup_signals(void) > -{ > - struct sigaction act; > - sigset_t mask; > - > - sigemptyset(&mask); > - sigaddset(&mask, SIGUSR1); > - sigaddset(&mask, SIGUSR2); > - sigprocmask(SIG_BLOCK, &mask, NULL); > - > - act.sa_handler = child_sigusr1; > - act.sa_flags = 0; > - sigemptyset(&act.sa_mask); > - > - if (sigaction(SIGUSR1, &act, NULL)) { > - perror("oprofiled: install of SIGUSR1 handler failed"); > - exit(EXIT_FAILURE); > - } > - > - act.sa_handler = child_sigusr2; > - act.sa_flags = 0; > - sigemptyset(&act.sa_mask); > - > - if (sigaction(SIGUSR2, &act, NULL)) { > - perror("oprofiled: install of SIGUSR2 handler failed"); > - exit(EXIT_FAILURE); > - } > - > - act.sa_handler = child_sigterm; > - act.sa_flags = 0; > - sigemptyset(&act.sa_mask); > - > - if (sigaction(SIGTERM, &act, NULL)) { > - perror("oprofiled: install of SIGTERM handler failed"); > - exit(EXIT_FAILURE); > - } > -} > - > - > -/** create the per-cpu context */ > -static void create_context(struct child * self) > -{ > - pfarg_context_t ctx; > - int err; > - > - memset(&ctx, 0, sizeof(pfarg_context_t)); > - memcpy(&ctx.ctx_smpl_buf_id, &uuid, 16); > - ctx.ctx_flags = PFM_FL_SYSTEM_WIDE; > - > - err = perfmonctl(0, PFM_CREATE_CONTEXT, &ctx, 1); > - if (err == -1) { > - perror("CREATE_CONTEXT failed"); > - exit(EXIT_FAILURE); > - } > - > - self->ctx_fd = ctx.ctx_fd; > -} > - > - > -/** program the perfmon counters */ > -static void write_pmu(struct child * self) > -{ > - pfarg_reg_t pc[OP_MAX_COUNTERS]; > - pfarg_reg_t pd[OP_MAX_COUNTERS]; > - int err; > - size_t i; > - > - memset(pc, 0, sizeof(pc)); > - memset(pd, 0, sizeof(pd)); > - > -#define PMC_GEN_INTERRUPT (1UL << 5) > -#define PMC_PRIV_MONITOR (1UL << 6) > -/* McKinley requires pmc4 to have bit 23 set (enable PMU). > - * It is supposedly ignored in other pmc registers. > - */ > -#define PMC_MANDATORY (1UL << 23) > -#define PMC_USER (1UL << 3) > -#define PMC_KERNEL (1UL << 0) > - for (i = 0; i < op_nr_counters && opd_events[i].name; ++i) { > - struct opd_event * event = &opd_events[i]; > - pc[i].reg_num = event->counter + 4; > - pc[i].reg_value = PMC_GEN_INTERRUPT; > - pc[i].reg_value |= PMC_PRIV_MONITOR; > - pc[i].reg_value |= PMC_MANDATORY; > - (event->user) ? (pc[i].reg_value |= PMC_USER) > - : (pc[i].reg_value &= ~PMC_USER); > - (event->kernel) ? (pc[i].reg_value |= PMC_KERNEL) > - : (pc[i].reg_value &= ~PMC_KERNEL); > - pc[i].reg_value &= ~(0xff << 8); > - pc[i].reg_value |= ((event->value & 0xff) << 8); > - pc[i].reg_value &= ~(0xf << 16); > - pc[i].reg_value |= ((event->um & 0xf) << 16); > - pc[i].reg_smpl_eventid = event->counter; > - } > - > - for (i = 0; i < op_nr_counters && opd_events[i].name; ++i) { > - struct opd_event * event = &opd_events[i]; > - pd[i].reg_value = ~0UL - event->count + 1; > - pd[i].reg_short_reset = ~0UL - event->count + 1; > - pd[i].reg_num = event->counter + 4; > - } > - > - err = perfmonctl(self->ctx_fd, PFM_WRITE_PMCS, pc, i); > - if (err == -1) { > - perror("Couldn't write PMCs"); > - exit(EXIT_FAILURE); > - } > - > - err = perfmonctl(self->ctx_fd, PFM_WRITE_PMDS, pd, i); > - if (err == -1) { > - perror("Couldn't write PMDs"); > - exit(EXIT_FAILURE); > - } > -} > - > - > -static void load_context(struct child * self) > -{ > - pfarg_load_t load_args; > - int err; > - > - memset(&load_args, 0, sizeof(load_args)); > - load_args.load_pid = self->pid; > - > - err = perfmonctl(self->ctx_fd, PFM_LOAD_CONTEXT, &load_args, 1); > - if (err == -1) { > - perror("Couldn't load context"); > - exit(EXIT_FAILURE); > - } > -} > - > - > -static void notify_parent(struct child * self, size_t cpu) > -{ > - for (;;) { > - ssize_t ret; > - ret = write(self->up_pipe[1], &cpu, sizeof(size_t)); > - if (ret == sizeof(size_t)) > - break; > - if (ret < 0 && errno != EINTR) { > - perror("Failed to write child pipe:"); > - exit(EXIT_FAILURE); > - } > - } > -} > - > -static struct child * inner_child; > -void close_pipe(void) > -{ > - close(inner_child->up_pipe[1]); > -} > - > -static void run_child(size_t cpu) > -{ > - struct child * self = &children[cpu]; > - > - self->pid = getpid(); > - self->sigusr1 = 0; > - self->sigusr2 = 0; > - self->sigterm = 0; > - > - inner_child = self; > - if (atexit(close_pipe)){ > - close_pipe(); > - exit(EXIT_FAILURE); > - } > - > - umask(0); > - /* Change directory to allow directory to be removed */ > - if (chdir("/") < 0) { > - perror("Unable to chdir to \"/\""); > - exit(EXIT_FAILURE); > - } > - > - setup_signals(); > - > - set_affinity(cpu); > - > - create_context(self); > - > - write_pmu(self); > - > - load_context(self); > - > - notify_parent(self, cpu); > - > - /* Redirect standard files to /dev/null */ > - freopen( "/dev/null", "r", stdin); > - freopen( "/dev/null", "w", stdout); > - freopen( "/dev/null", "w", stderr); > - > - for (;;) { > - sigset_t sigmask; > - sigfillset(&sigmask); > - sigdelset(&sigmask, SIGUSR1); > - sigdelset(&sigmask, SIGUSR2); > - sigdelset(&sigmask, SIGTERM); > - > - if (self->sigusr1) { > - perfmon_start_child(self->ctx_fd); > - self->sigusr1 = 0; > - } > - > - if (self->sigusr2) { > - perfmon_stop_child(self->ctx_fd); > - self->sigusr2 = 0; > - } > - > - sigsuspend(&sigmask); > - } > -} > - > - > -static void wait_for_child(struct child * child) > -{ > - size_t tmp; > - for (;;) { > - ssize_t ret; > - ret = read(child->up_pipe[0], &tmp, sizeof(size_t)); > - if (ret == sizeof(size_t)) > - break; > - if ((ret < 0 && errno != EINTR) || ret == 0 ) { > - perror("Failed to read child pipe"); > - exit(EXIT_FAILURE); > - } > - } > - printf("Perfmon child up on CPU%d\n", (int)tmp); > - fflush(stdout); > - > - close(child->up_pipe[0]); > -} > - > -static struct child* xen_ctx; > - > -void perfmon_init(void) > -{ > - size_t i; > - long nr; > - > - if (cpu_type == CPU_TIMER_INT) > - return; > - > - if (!no_xen) { > - xen_ctx = xmalloc(sizeof(struct child)); > - xen_ctx->pid = getpid(); > - xen_ctx->up_pipe[0] = -1; > - xen_ctx->up_pipe[1] = -1; > - xen_ctx->sigusr1 = 0; > - xen_ctx->sigusr2 = 0; > - xen_ctx->sigterm = 0; > - > - create_context(xen_ctx); > - > - write_pmu(xen_ctx); > - > - load_context(xen_ctx); > - return; > - } > - > - > - nr = sysconf(_SC_NPROCESSORS_ONLN); > - if (nr == -1) { > - fprintf(stderr, "Couldn't determine number of CPUs.\n"); > - exit(EXIT_FAILURE); > - } > - > - nr_cpus = nr; > - > - children = xmalloc(sizeof(struct child) * nr_cpus); > - bzero(children, sizeof(struct child) * nr_cpus); > - > - for (i = 0; i < nr_cpus; ++i) { > - int ret; > - > - if (pipe(children[i].up_pipe)) { > - perror("Couldn't create child pipe"); > - exit(EXIT_FAILURE); > - } > - > - ret = fork(); > - if (ret == -1) { > - perror("Couldn't fork perfmon child"); > - exit(EXIT_FAILURE); > - } else if (ret == 0) { > - close(children[i].up_pipe[0]); > - run_child(i); > - } else { > - children[i].pid = ret; > - close(children[i].up_pipe[1]); > - printf("Waiting on CPU%d\n", (int)i); > - wait_for_child(&children[i]); > - } > - } > -} > - > - > -void perfmon_exit(void) > -{ > - size_t i; > - > - if (cpu_type == CPU_TIMER_INT) > - return; > - > - if (!no_xen) > - return; > - > - for (i = 0; i < nr_cpus; ++i) { > - if (children[i].pid) { > - int c_pid = children[i].pid; > - children[i].pid = 0; > - if (kill(c_pid, SIGKILL)==0) > - waitpid(c_pid, NULL, 0); > - } > - } > -} > - > - > -void perfmon_start(void) > -{ > - size_t i; > - > - if (cpu_type == CPU_TIMER_INT) > - return; > - > - if (!no_xen) { > - perfmon_start_child(xen_ctx->ctx_fd); > - return; > - } > - > - for (i = 0; i < nr_cpus; ++i) { > - if (kill(children[i].pid, SIGUSR1)) { > - perror("Unable to start perfmon"); > - exit(EXIT_FAILURE); > - } > - } > -} > - > - > -void perfmon_stop(void) > -{ > - size_t i; > - > - if (cpu_type == CPU_TIMER_INT) > - return; > - > - if (!no_xen) { > - perfmon_stop_child(xen_ctx->ctx_fd); > - return; > - } > - > - for (i = 0; i < nr_cpus; ++i) > - if (kill(children[i].pid, SIGUSR2)) { > - perror("Unable to stop perfmon"); > - exit(EXIT_FAILURE); > - } > -} > - > -#endif /* __ia64__ */ > diff --git a/daemon/opd_perfmon.h b/daemon/opd_perfmon.h > deleted file mode 100644 > index 9b4267f..0000000 > --- a/daemon/opd_perfmon.h > +++ /dev/null > @@ -1,106 +0,0 @@ > -/** > - * @file opd_perfmon.h > - * perfmonctl() handling > - * > - * @remark Copyright 2003 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - */ > - > -#ifndef OPD_PERFMON_H > -#define OPD_PERFMON_H > - > -#ifdef __ia64__ > - > -#include <stdlib.h> > - > -void perfmon_init(void); > -void perfmon_exit(void); > -void perfmon_start(void); > -void perfmon_stop(void); > - > -/* The following is from asm/perfmon.h. When it's installed on > - * enough boxes, we can remove this and include the platform > - * perfmon.h > - */ > - > -typedef unsigned char pfm_uuid_t[16]; /* custom sampling buffer identifier type */ > - > -/* > - * Request structure used to define a context > - */ > -typedef struct { > - pfm_uuid_t ctx_smpl_buf_id; /* which buffer format to use (if needed) */ > - unsigned long ctx_flags; /* noblock/block */ > - unsigned short ctx_nextra_sets; /* number of extra event sets (you always get 1) */ > - unsigned short ctx_reserved1; /* for future use */ > - int ctx_fd; /* return arg: unique identification for context */ > - void *ctx_smpl_vaddr; /* return arg: virtual address of sampling buffer, is used */ > - unsigned long ctx_reserved2[11];/* for future use */ > -} pfarg_context_t; > - > -/* > - * Request structure used to write/read a PMC or PMD > - */ > -typedef struct { > - unsigned int reg_num; /* which register */ > - unsigned short reg_set; /* event set for this register */ > - unsigned short reg_reserved1; /* for future use */ > - > - unsigned long reg_value; /* initial pmc/pmd value */ > - unsigned long reg_flags; /* input: pmc/pmd flags, return: reg error */ > - > - unsigned long reg_long_reset; /* reset after buffer overflow notification */ > - unsigned long reg_short_reset; /* reset after counter overflow */ > - > - unsigned long reg_reset_pmds[4]; /* which other counters to reset on overflow */ > - unsigned long reg_random_seed; /* seed value when randomization is used */ > - unsigned long reg_random_mask; /* bitmask used to limit random value */ > - unsigned long reg_last_reset_val;/* return: PMD last reset value */ > - > - unsigned long reg_smpl_pmds[4]; /* which pmds are accessed when PMC overflows */ > - unsigned long reg_smpl_eventid; /* opaque sampling event identifier */ > - > - unsigned long reg_reserved2[3]; /* for future use */ > -} pfarg_reg_t; > - > -typedef struct { > - pid_t load_pid; /* process to load the context into */ > - unsigned short load_set; /* first event set to load */ > - unsigned short load_reserved1; /* for future use */ > - unsigned long load_reserved2[3]; /* for future use */ > -} pfarg_load_t; > - > -#define PFM_WRITE_PMCS 0x01 > -#define PFM_WRITE_PMDS 0x02 > -#define PFM_STOP 0x04 > -#define PFM_START 0x05 > -#define PFM_CREATE_CONTEXT 0x08 > -#define PFM_LOAD_CONTEXT 0x10 > -#define PFM_FL_SYSTEM_WIDE 0x02 > - > -#else > - > -void perfmon_init(void) > -{ > -} > - > - > -void perfmon_exit(void) > -{ > -} > - > - > -void perfmon_start(void) > -{ > -} > - > - > -void perfmon_stop(void) > -{ > -} > - > -#endif /* __ia64__ */ > - > -#endif /* OPD_PERFMON_H */ > diff --git a/daemon/opd_pipe.c b/daemon/opd_pipe.c > deleted file mode 100644 > index 3c81979..0000000 > --- a/daemon/opd_pipe.c > +++ /dev/null > @@ -1,99 +0,0 @@ > -/** > - * @file daemon/opd_pipe.c > - * Functions handling the $SESSIONDIR/opd_pipe FIFO special file. > - * NOTE: This code is dealing with potentially insecure input. > - * > - * @remark Copyright 2008 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Daniel Hansel > - */ > - > -#include "opd_pipe.h" > -#include "opd_printf.h" > -#include "op_config.h" > - > -#include <stdio.h> > -#include <stdlib.h> > -#include <string.h> > -#include <fcntl.h> > -#include <unistd.h> > -#include <errno.h> > -#include <sys/stat.h> > - > -static int fifo; > -static FILE * fifo_fd = NULL; > - > -void opd_create_pipe(void) > -{ > - mode_t orig_umask = umask(0111); > - if (mkfifo(op_pipe_file, 0666) == -1) { > - if (errno != EEXIST) { > - perror("oprofiled: couldn't create pipe: "); > - exit(EXIT_FAILURE); > - } > - } > - umask(orig_umask); > -} > - > - > -void opd_open_pipe(void) > -{ > - fifo = open(op_pipe_file, O_RDONLY | O_NONBLOCK); > - if (fifo == -1) { > - perror("oprofiled: couldn't open pipe: "); > - exit(EXIT_FAILURE); > - } > -} > - > - > -void opd_close_pipe(void) > -{ > - if (fifo_fd) > - fclose(fifo_fd); > - close(fifo); > -} > - > - > -int is_jitconv_requested(void) > -{ > - /* number of dropped (unknown) requests */ > - static long nr_drops = 0; > - /* modulus to output only a few warnings to avoid flooding oprofiled.log */ > - static int mod_cnt_drops = 1; > - char line[256]; > - int i, ret = 0; > - > - /* get a file descriptor to the pipe */ > - if (!fifo_fd) > - fifo_fd = fdopen(fifo, "r"); > - > - if (fifo_fd == NULL) { > - perror("oprofiled: couldn't create file descriptor: "); > - exit(EXIT_FAILURE); > - } > - > - /* read up to 99 lines to check for 'do_jitconv' */ > - for (i = 0; i < 99; i++) { > - /* just break if no new line is found */ > - if (fgets(line, 256, fifo_fd) == NULL) > - break; > - line[strlen(line) - 1] = '\0'; > - > - if (strstr(line, "do_jitconv") != NULL) { > - ret = 1; > - } else { > - nr_drops++; > - > - if (nr_drops % mod_cnt_drops == 0) { > - printf( > - "Warning: invalid pipe request received (dropped request(s): %ld)\n", > - nr_drops); > - /* increase modulus to avoid flooding log file */ > - mod_cnt_drops *= 5; > - } > - } > - } > - > - return ret; > -} > diff --git a/daemon/opd_pipe.h b/daemon/opd_pipe.h > deleted file mode 100644 > index 7f96b07..0000000 > --- a/daemon/opd_pipe.h > +++ /dev/null > @@ -1,45 +0,0 @@ > -/** > - * @file daemon/opd_pipe.h > - * Functions handling the $SESSIONDIR/opd_pipe FIFO special file. > - * NOTE: This code is dealing with potencially insecure input. > - * > - * @remark Copyright 2008 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Daniel Hansel > - */ > - > -#ifndef OPD_PIPE_H_ > -#define OPD_PIPE_H_ > - > -/** > - * opd_create_pipe - creates the oprofiled fifo file > - * > - * Creates the Oprofile daemon fifo pipe to enable communication between > - * the daemon and the 'opcontrol --dump' command. Failure to create the pipe > - * is a fatal error. > - */ > -void opd_create_pipe(void); > - > -/** > - * opd_open_pipe - opens the oprofiled fifo file > - */ > -void opd_open_pipe(void); > - > -/** > - * opd_close_pipe - closes the oprofiled fifo file > - * > - * Closes the Oprofile daemon fifo pipe. > - */ > -void opd_close_pipe(void); > - > -/** > - * is_jitconv_requested - check for request to jit conversion > - * > - * Checks the Oprofile daemon fifo pipe for do_jitconv request. > - * If jit conversion is requested ('do_jitconv' is sent) the check returns 1. > - * Otherwise it returns 0. > - */ > -int is_jitconv_requested(void); > - > -#endif /*OPD_PIPE_H_*/ > diff --git a/daemon/opd_printf.h b/daemon/opd_printf.h > deleted file mode 100644 > index 09df07f..0000000 > --- a/daemon/opd_printf.h > +++ /dev/null > @@ -1,37 +0,0 @@ > -/** > - * @file daemon/opd_printf.h > - * Output routines > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#ifndef OPD_PRINTF_H > -#define OPD_PRINTF_H > - > -/// log all sample file name manipulation; sample files open, close, > -/// sfile LRU etc. voluminous. FIXME need to be splitted (filename manip, files > -/// handling) ? > -extern int vsfile; > -/// log samples, voluminous. > -extern int vsamples; > -/// log arc, very voluminous. > -extern int varcs; > -/// kernel module handling > -extern int vmodule; > -/// extended feature > -extern int vext; > -/// all others not fitting in above category, not voluminous. > -extern int vmisc; > - > -#define verbprintf(x, args...) \ > - do { \ > - /* look like fragile but we must catch verbrintf("%s", "") */ \ > - if (x == 1) \ > - printf(args); \ > - } while (0) > - > -#endif /* OPD_PRINTF_H */ > diff --git a/daemon/opd_sfile.c b/daemon/opd_sfile.c > deleted file mode 100644 > index a72a851..0000000 > --- a/daemon/opd_sfile.c > +++ /dev/null > @@ -1,751 +0,0 @@ > -/** > - * @file daemon/opd_sfile.c > - * Management of sample files > - * > - * @remark Copyright 2002, 2005 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#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> > - > -#define HASH_SIZE 2048 > -#define HASH_BITS (HASH_SIZE - 1) > - > -/** All sfiles are hashed into these lists */ > -static struct list_head hashes[HASH_SIZE]; > - > -/* This data structure is used to help us determine when we should > - * discard user context kernel samples for which we no longer have > - * an app name to which we can attribute them. This can happen (especially > - * on a busy system) in the following scenario: > - * - A user context switch occurs. > - * - User context kernel samples are recorded for this process. > - * - The user process ends. > - * - The above-mentioned sample information is first recorded into the per-CPU > - * buffer and later transferred to the main event buffer. Since the process > - * for which this context switch was recorded ended before the transfer > - * occurs, the app cookie that is recorded into the event buffer along with the > - * CTX_SWITCH_CODE will be set to NO_COOKIE. When the oprofile userspace daemon > - * processes the CTX_SWITCH_CODE, it sets trans->app_cookie to NO_COOKIE and then > - * continues to process the kernel samples. But having no appname in order to > - * locate the appropriate sample file, it creates a new sample file of the form: > - * <session_dir>/current/{kern}/<some_kernel_image>/{dep}/{kern}/<some_kernel_image>/<event_spec>.<tgid>.<tid>.<cpu> > - * > - * This is not really an invalid form for sample files, since it is certainly valid for > - * oprofile to collect samples for kernel threads that are not running in any process context. > - * Such samples would be stored in sample files like this, and opreport would show those > - * samples as having an appname of "<some_kernel_image>". But if the tgid/tid info for > - * the sample is from a defunct user process, we should discard these samples. Not doing so > - * can lead to strange results when generating reports by tgid/tid (i.e., appname of > - * "<some_kernel_image>" instead of the real app name associated with the given tgid/tid. > - * The following paragraph describes the technique for identifying and discarding such samples. > - * > - * When processing a kernel sample for which trans->app_cookie==NO_COOKIE, we inspect the > - * /proc/<pid>/cmdline file. Housekeeping types of kernel threads (e.g., kswapd, watchdog) > - * won't have a command line since they exist and operate outside of a process context. > - * However, other kernel "tasks" do operate within a process context (e.g., some kernel > - * driver functions, kernel functions invoked via a syscall, etc.). When we get samples > - * for the latter type of task but no longer have app name info for the process for which > - * the kernel task is performing work, we cannot correctly attribute those kernel samples > - * to a user application, so they should be discarded. We classify the two different types > - * of kernel "tasks" based on whether or not the /proc/<pid>/cmdline is empty. We cache > - * the results in kernel_cmdlines for fast lookup when processing samples. > - */ > -static struct list_head kernel_cmdlines[HASH_SIZE]; > -struct kern_cmdline { > - pid_t kern_pid; > - struct list_head hash; > - unsigned int has_cmdline; > -}; > - > -/** All sfiles are on this list. */ > -static LIST_HEAD(lru_list); > - > - > -/* FIXME: can undoubtedly improve this hashing */ > -/** Hash the transient parameters for lookup. */ > -static unsigned long > -sfile_hash(struct transient const * trans, struct kernel_image * ki) > -{ > - unsigned long val = 0; > - > - if (separate_thread) { > - val ^= trans->tid << 2; > - val ^= trans->tgid << 2; > - } > - > - if (separate_kernel || ((trans->anon || separate_lib) && !ki)) > - val ^= trans->app_cookie >> (DCOOKIE_SHIFT + 3); > - > - if (separate_cpu) > - val ^= trans->cpu; > - > - /* cookie meaningless for kernel, shouldn't hash */ > - if (trans->in_kernel && ki) { > - val ^= ki->start >> 14; > - val ^= ki->end >> 7; > - return val & HASH_BITS; > - } > - > - if (trans->cookie != NO_COOKIE) { > - val ^= trans->cookie >> DCOOKIE_SHIFT; > - return val & HASH_BITS; > - } > - > - if (!separate_thread) > - val ^= trans->tgid << 2; > - > - if (trans->anon) { > - val ^= trans->anon->start >> VMA_SHIFT; > - val ^= trans->anon->end >> (VMA_SHIFT + 1); > - } > - > - return val & HASH_BITS; > -} > - > - > -static int > -do_match(struct sfile const * sf, cookie_t cookie, cookie_t app_cookie, > - struct kernel_image const * ki, struct anon_mapping const * anon, > - pid_t tgid, pid_t tid, unsigned int cpu) > -{ > - /* this is a simplified check for "is a kernel image" AND > - * "is the right kernel image". Also handles no-vmlinux > - * correctly. > - */ > - if (sf->kernel != ki) > - return 0; > - > - if (separate_thread) { > - if (sf->tid != tid || sf->tgid != tgid) > - return 0; > - } > - > - if (separate_cpu) { > - if (sf->cpu != cpu) > - return 0; > - } > - > - if (separate_kernel || ((anon || separate_lib) && !ki)) { > - if (sf->app_cookie != app_cookie) > - return 0; > - } > - > - /* ignore the cached trans->cookie for kernel images, > - * it's meaningless and we checked all others already > - */ > - if (ki) > - return 1; > - > - if (sf->anon != anon) > - return 0; > - > - return sf->cookie == cookie; > -} > - > - > -static int > -trans_match(struct transient const * trans, struct sfile const * sfile, > - struct kernel_image const * ki) > -{ > - return do_match(sfile, trans->cookie, trans->app_cookie, ki, > - trans->anon, trans->tgid, trans->tid, trans->cpu); > -} > - > - > -int > -sfile_equal(struct sfile const * sf, struct sfile const * sf2) > -{ > - return do_match(sf, sf2->cookie, sf2->app_cookie, sf2->kernel, > - sf2->anon, sf2->tgid, sf2->tid, sf2->cpu); > -} > - > - > -static int > -is_sf_ignored(struct sfile const * sf) > -{ > - if (sf->kernel) { > - if (!is_image_ignored(sf->kernel->name)) > - return 0; > - > - /* Let a dependent kernel image redeem the sf if we're > - * executing on behalf of an application. > - */ > - return is_cookie_ignored(sf->app_cookie); > - } > - > - /* Anon regions are always dependent on the application. > - * Otherwise, let a dependent image redeem the sf. > - */ > - if (sf->anon || is_cookie_ignored(sf->cookie)) > - return is_cookie_ignored(sf->app_cookie); > - > - return 0; > -} > - > - > -/** create a new sfile matching the current transient parameters */ > -static struct sfile * > -create_sfile(unsigned long hash, struct transient const * trans, > - struct kernel_image * ki) > -{ > - size_t i; > - struct sfile * sf; > - > - sf = xmalloc(sizeof(struct sfile)); > - > - sf->hashval = hash; > - > - /* The logic here: if we're in the kernel, the cached cookie is > - * meaningless (though not the app_cookie if separate_kernel) > - */ > - sf->cookie = trans->in_kernel ? INVALID_COOKIE : trans->cookie; > - sf->app_cookie = INVALID_COOKIE; > - sf->tid = (pid_t)-1; > - sf->tgid = (pid_t)-1; > - sf->cpu = 0; > - sf->kernel = ki; > - sf->anon = trans->anon; > - > - for (i = 0 ; i < op_nr_counters ; ++i) > - odb_init(&sf->files[i]); > - > - if (trans->ext) > - opd_ext_sfile_create(sf); > - else > - sf->ext_files = NULL; > - > - for (i = 0; i < CG_HASH_SIZE; ++i) > - list_init(&sf->cg_hash[i]); > - > - if (separate_thread) > - sf->tid = trans->tid; > - if (separate_thread || trans->cookie == NO_COOKIE) > - sf->tgid = trans->tgid; > - > - if (separate_cpu) > - sf->cpu = trans->cpu; > - > - if (separate_kernel || ((trans->anon || separate_lib) && !ki)) > - sf->app_cookie = trans->app_cookie; > - > - sf->ignored = is_sf_ignored(sf); > - > - sf->embedded_offset = trans->embedded_offset; > - > - /* If embedded_offset is a valid value, it means we're > - * processing a Cell BE SPU profile; in which case, we > - * want sf->app_cookie to hold trans->app_cookie. > - */ > - if (trans->embedded_offset != UNUSED_EMBEDDED_OFFSET) > - sf->app_cookie = trans->app_cookie; > - return sf; > -} > - > - > -struct sfile * sfile_find(struct transient const * trans) > -{ > - struct sfile * sf; > - struct list_head * pos; > - struct kernel_image * ki = NULL; > - unsigned long hash; > - > - /* There is a small race where this *can* happen, see > - * caller of cpu_buffer_reset() in the kernel > - */ > - if (trans->in_kernel == -1) { > - verbprintf(vsamples, "Losing sample at 0x%llx of unknown provenance.\n", > - trans->pc); > - opd_stats[OPD_NO_CTX]++; > - return NULL; > - } > - > - /* we might need a kernel image start/end to hash on */ > - if (trans->in_kernel) { > - ki = find_kernel_image(trans); > - if (!ki) { > - verbprintf(vsamples, "Lost kernel sample %llx\n", trans->pc); > - opd_stats[OPD_LOST_KERNEL]++; > - return NULL; > - } > - // We *know* that PID 0, 1, and 2 are pure kernel context tasks, so > - // we always want to keep these samples. > - if ((trans->tgid == 0) || (trans->tgid == 1) || (trans->tgid == 2)) > - goto find_sfile; > - > - // Decide whether or not this kernel sample should be discarded. > - // See detailed description above where the kernel_cmdlines hash > - // table is defined. > - if (trans->app_cookie == NO_COOKIE) { > - int found = 0; > - struct kern_cmdline * kcmd; > - hash = (trans->tgid << 2) & HASH_BITS; > - list_for_each(pos, &kernel_cmdlines[hash]) { > - kcmd = list_entry(pos, struct kern_cmdline, hash); > - if (kcmd->kern_pid == trans->tgid) { > - found = 1; > - if (kcmd->has_cmdline) { > - verbprintf(vsamples, > - "Dropping user context kernel sample 0x%llx " > - "for process %u due to no app cookie available.\n", > - (unsigned long long)trans->pc, trans->tgid); > - opd_stats[OPD_NO_APP_KERNEL_SAMPLE]++; > - return NULL; > - } > - break; > - } > - } > - if (!found) { > - char name[32], dst[8]; > - int fd, dropped = 0; > - kcmd = (struct kern_cmdline *)xmalloc(sizeof(*kcmd)); > - kcmd->kern_pid = trans->tgid; > - snprintf(name, sizeof name, "/proc/%u/cmdline", trans->tgid); > - fd = open(name, O_RDONLY); > - if(fd==-1) { > - // Most likely due to process ending, so we'll assume it used to have a cmdline > - kcmd->has_cmdline = 1; > - verbprintf(vsamples, > - "Open of /proc/%u/cmdline failed, so dropping " > - "kernel sameple 0x%llx\n", > - trans->tgid, (unsigned long long)trans->pc); > - opd_stats[OPD_NO_APP_KERNEL_SAMPLE]++; > - dropped = 1; > - } else { > - if((read(fd, dst, 8) < 1)) { > - verbprintf(vsamples, "No cmdline for PID %u\n", trans->tgid); > - kcmd->has_cmdline = 0; > - } else { > - // This *really* shouldn't happen. If it does, then why don't > - // we have an app_cookie? > - dst[7] = '\0'; > - verbprintf(vsamples, "Start of cmdline for PID %u is %s\n", trans->tgid, dst); > - kcmd->has_cmdline = 1; > - opd_stats[OPD_NO_APP_KERNEL_SAMPLE]++; > - dropped = 1; > - } > - close(fd); > - } > - list_add(&kcmd->hash, &kernel_cmdlines[hash]); > - if (dropped) > - return NULL; > - } > - } > - } else if (trans->cookie == NO_COOKIE && !trans->anon) { > - if (vsamples) { > - char const * app = verbose_cookie(trans->app_cookie); > - printf("No anon map for pc %llx, app %s.\n", > - trans->pc, app); > - } > - opd_stats[OPD_LOST_NO_MAPPING]++; > - return NULL; > - } > - > -find_sfile: > - hash = sfile_hash(trans, ki); > - list_for_each(pos, &hashes[hash]) { > - sf = list_entry(pos, struct sfile, hash); > - if (trans_match(trans, sf, ki)) { > - sfile_get(sf); > - goto lru; > - } > - } > - > - sf = create_sfile(hash, trans, ki); > - list_add(&sf->hash, &hashes[hash]); > - > -lru: > - sfile_put(sf); > - return sf; > -} > - > - > -void sfile_dup(struct sfile * to, struct sfile * from) > -{ > - size_t i; > - > - memcpy(to, from, sizeof (struct sfile)); > - > - for (i = 0 ; i < op_nr_counters ; ++i) > - odb_init(&to->files[i]); > - > - opd_ext_sfile_dup(to, from); > - > - for (i = 0; i < CG_HASH_SIZE; ++i) > - list_init(&to->cg_hash[i]); > - > - list_init(&to->hash); > - list_init(&to->lru); > -} > - > - > -static odb_t * get_file(struct transient const * trans, int is_cg) > -{ > - struct sfile * sf = trans->current; > - struct sfile * last = trans->last; > - struct cg_entry * cg; > - struct list_head * pos; > - unsigned long hash; > - odb_t * file; > - > - if ((trans->ext) != NULL) > - return opd_ext_sfile_get(trans, is_cg); > - > - if (trans->event >= op_nr_counters) { > - fprintf(stderr, "%s: Invalid counter %lu\n", __FUNCTION__, > - trans->event); > - abort(); > - } > - > - file = &sf->files[trans->event]; > - > - if (!is_cg) > - goto open; > - > - hash = last->hashval & (CG_HASH_SIZE - 1); > - > - /* Need to look for the right 'to'. Since we're looking for > - * 'last', we use its hash. > - */ > - list_for_each(pos, &sf->cg_hash[hash]) { > - cg = list_entry(pos, struct cg_entry, hash); > - if (sfile_equal(last, &cg->to)) { > - file = &cg->to.files[trans->event]; > - goto open; > - } > - } > - > - cg = xmalloc(sizeof(struct cg_entry)); > - sfile_dup(&cg->to, last); > - list_add(&cg->hash, &sf->cg_hash[hash]); > - file = &cg->to.files[trans->event]; > - > -open: > - if (!odb_open_count(file)) > - opd_open_sample_file(file, last, sf, trans->event, is_cg); > - > - /* Error is logged by opd_open_sample_file */ > - if (!odb_open_count(file)) > - return NULL; > - > - return file; > -} > - > - > -static void verbose_print_sample(struct sfile * sf, vma_t pc, uint counter) > -{ > - char const * app = verbose_cookie(sf->app_cookie); > - printf("0x%llx(%u): ", pc, counter); > - if (sf->anon) { > - printf("anon (tgid %u, 0x%llx-0x%llx), ", > - (unsigned int)sf->anon->tgid, > - sf->anon->start, sf->anon->end); > - } else if (sf->kernel) { > - printf("kern (name %s, 0x%llx-0x%llx), ", sf->kernel->name, > - sf->kernel->start, sf->kernel->end); > - } else { > - printf("%s(%llx), ", verbose_cookie(sf->cookie), sf->cookie); > - } > - printf("app %s(%llx)", app, sf->app_cookie); > -} > - > - > -static void verbose_sample(struct transient const * trans, vma_t pc) > -{ > - printf("Sample "); > - verbose_print_sample(trans->current, pc, trans->event); > - printf("\n"); > -} > - > - > -static void > -verbose_arc(struct transient const * trans, vma_t from, vma_t to) > -{ > - printf("Arc "); > - verbose_print_sample(trans->current, from, trans->event); > - printf(" -> 0x%llx", to); > - printf("\n"); > -} > - > - > -static void sfile_log_arc(struct transient const * trans) > -{ > - int err; > - vma_t from = trans->pc; > - vma_t to = trans->last_pc; > - uint64_t key; > - odb_t * file; > - > - file = get_file(trans, 1); > - > - /* absolute value -> offset */ > - if (trans->current->kernel) > - from -= trans->current->kernel->start; > - > - if (trans->last->kernel) > - to -= trans->last->kernel->start; > - > - if (trans->current->anon) > - from -= trans->current->anon->start; > - > - if (trans->last->anon) > - to -= trans->last->anon->start; > - > - if (varcs) > - verbose_arc(trans, from, to); > - > - if (!file) { > - opd_stats[OPD_LOST_SAMPLEFILE]++; > - return; > - } > - > - /* Possible narrowings to 32-bit value only. */ > - key = to & (0xffffffff); > - key |= ((uint64_t)from) << 32; > - > - err = odb_update_node(file, key); > - if (err) { > - fprintf(stderr, "%s: %s\n", __FUNCTION__, strerror(err)); > - abort(); > - } > -} > - > - > -void sfile_log_sample(struct transient const * trans) > -{ > - sfile_log_sample_count(trans, 1); > -} > - > - > -void sfile_log_sample_count(struct transient const * trans, > - unsigned long int count) > -{ > - int err; > - vma_t pc = trans->pc; > - odb_t * file; > - > - if (trans->tracing == TRACING_ON) { > - /* can happen if kernel sample falls through the cracks, > - * see opd_put_sample() */ > - if (trans->last) > - sfile_log_arc(trans); > - return; > - } > - > - file = get_file(trans, 0); > - > - /* absolute value -> offset */ > - if (trans->current->kernel) > - pc -= trans->current->kernel->start; > - > - if (trans->current->anon) > - pc -= trans->current->anon->start; > - > - if (vsamples) > - verbose_sample(trans, pc); > - > - if (!file) { > - opd_stats[OPD_LOST_SAMPLEFILE]++; > - return; > - } > - > - err = odb_update_node_with_offset(file, > - (odb_key_t)pc, > - count); > - if (err) { > - fprintf(stderr, "%s: %s\n", __FUNCTION__, strerror(err)); > - abort(); > - } > -} > - > - > -static int close_sfile(struct sfile * sf, void * data __attribute__((unused))) > -{ > - size_t i; > - > - /* it's OK to close a non-open odb file */ > - for (i = 0; i < op_nr_counters; ++i) > - odb_close(&sf->files[i]); > - > - opd_ext_sfile_close(sf); > - > - return 0; > -} > - > - > -static void kill_sfile(struct sfile * sf) > -{ > - close_sfile(sf, NULL); > - list_del(&sf->hash); > - list_del(&sf->lru); > -} > - > - > -static int sync_sfile(struct sfile * sf, void * data __attribute__((unused))) > -{ > - size_t i; > - > - for (i = 0; i < op_nr_counters; ++i) > - odb_sync(&sf->files[i]); > - > - opd_ext_sfile_sync(sf); > - > - return 0; > -} > - > - > -static int is_sfile_kernel(struct sfile * sf, void * data __attribute__((unused))) > -{ > - return !!sf->kernel; > -} > - > - > -static int is_sfile_anon(struct sfile * sf, void * data) > -{ > - return sf->anon == data; > -} > - > - > -typedef int (*sfile_func)(struct sfile *, void *); > - > -static void > -for_one_sfile(struct sfile * sf, sfile_func func, void * data) > -{ > - size_t i; > - int free_sf = func(sf, data); > - > - for (i = 0; i < CG_HASH_SIZE; ++i) { > - struct list_head * pos; > - struct list_head * pos2; > - list_for_each_safe(pos, pos2, &sf->cg_hash[i]) { > - struct cg_entry * cg = > - list_entry(pos, struct cg_entry, hash); > - if (free_sf || func(&cg->to, data)) { > - kill_sfile(&cg->to); > - list_del(&cg->hash); > - free(cg); > - } > - } > - } > - > - if (free_sf) { > - kill_sfile(sf); > - free(sf); > - } > -} > - > - > -static void for_each_sfile(sfile_func func, void * data) > -{ > - struct list_head * pos; > - struct list_head * pos2; > - > - list_for_each_safe(pos, pos2, &lru_list) { > - struct sfile * sf = list_entry(pos, struct sfile, lru); > - for_one_sfile(sf, func, data); > - } > -} > - > - > -void sfile_clear_kernel(void) > -{ > - for_each_sfile(is_sfile_kernel, NULL); > -} > - > - > -void sfile_clear_anon(struct anon_mapping * anon) > -{ > - for_each_sfile(is_sfile_anon, anon); > -} > - > - > -void sfile_sync_files(void) > -{ > - for_each_sfile(sync_sfile, NULL); > -} > - > - > -void sfile_close_files(void) > -{ > - for_each_sfile(close_sfile, NULL); > -} > - > - > -static int always_true(void) > -{ > - return 1; > -} > - > - > -#define LRU_AMOUNT 256 > - > -/* > - * Clear out older sfiles. Note the current sfiles we're using > - * will not be present in this list, due to sfile_get/put() pairs > - * around the caller of this. > - */ > -int sfile_lru_clear(void) > -{ > - struct list_head * pos; > - struct list_head * pos2; > - int amount = LRU_AMOUNT; > - > - if (list_empty(&lru_list)) > - return 1; > - > - list_for_each_safe(pos, pos2, &lru_list) { > - struct sfile * sf; > - if (!--amount) > - break; > - sf = list_entry(pos, struct sfile, lru); > - for_one_sfile(sf, (sfile_func)always_true, NULL); > - } > - > - return 0; > -} > - > - > -void sfile_get(struct sfile * sf) > -{ > - if (sf) > - list_del(&sf->lru); > -} > - > - > -void sfile_put(struct sfile * sf) > -{ > - if (sf) > - list_add_tail(&sf->lru, &lru_list); > -} > - > - > -void sfile_init(void) > -{ > - size_t i = 0; > - > - for (; i < HASH_SIZE; ++i) { > - list_init(&hashes[i]); > - list_init(&kernel_cmdlines[i]); > - } > -} > diff --git a/daemon/opd_sfile.h b/daemon/opd_sfile.h > deleted file mode 100644 > index 76e5e63..0000000 > --- a/daemon/opd_sfile.h > +++ /dev/null > @@ -1,119 +0,0 @@ > -/** > - * @file daemon/opd_sfile.h > - * Management of sample files > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#ifndef OPD_SFILE_H > -#define OPD_SFILE_H > - > -#include "opd_cookie.h" > - > -#include "odb.h" > -#include "op_hw_config.h" > -#include "op_types.h" > -#include "op_list.h" > - > -#include <sys/types.h> > - > -struct kernel_image; > -struct transient; > - > -#define CG_HASH_SIZE 16 > -#define UNUSED_EMBEDDED_OFFSET ~0LLU > - > -/** > - * Each set of sample files (where a set is over the physical counter > - * types) will have one of these for it. We match against the > - * descriptions here to find which sample DB file we need to modify. > - * > - * cg files are stored in the hash. > - */ > -struct sfile { > - /** hash value for this sfile */ > - unsigned long hashval; > - /** cookie value for the binary profiled */ > - cookie_t cookie; > - /** cookie value for the application owner, INVALID_COOKIE if not set */ > - cookie_t app_cookie; > - /** thread ID, -1 if not set */ > - pid_t tid; > - /** thread group ID, -1 if not set */ > - pid_t tgid; > - /** CPU number */ > - unsigned int cpu; > - /** kernel image if applicable */ > - struct kernel_image * kernel; > - /** anonymous mapping */ > - struct anon_mapping * anon; > - /** embedded offset for Cell BE SPU */ > - uint64_t embedded_offset; > - > - /** hash table link */ > - struct list_head hash; > - /** lru list */ > - struct list_head lru; > - /** true if this file should be ignored in profiles */ > - int ignored; > - /** opened sample files */ > - odb_t files[OP_MAX_COUNTERS]; > - /** extended sample files */ > - odb_t * ext_files; > - /** hash table of opened cg sample files */ > - struct list_head cg_hash[CG_HASH_SIZE]; > -}; > - > -/** a call-graph entry */ > -struct cg_entry { > - /** where arc is to */ > - struct sfile to; > - /** next in the hash slot */ > - struct list_head hash; > -}; > - > -/** clear any sfiles that are for the kernel */ > -void sfile_clear_kernel(void); > - > -struct anon_mapping; > - > -/** clear any sfiles for the given anon mapping */ > -void sfile_clear_anon(struct anon_mapping *); > - > -/** sync sample files */ > -void sfile_sync_files(void); > - > -/** close sample files */ > -void sfile_close_files(void); > - > -/** clear out a certain amount of LRU entries > - * return non-zero if the lru is already empty */ > -int sfile_lru_clear(void); > - > -/** remove a sfile from the lru list, protecting it from sfile_lru_clear() */ > -void sfile_get(struct sfile * sf); > - > -/** add this sfile to lru list */ > -void sfile_put(struct sfile * sf); > - > -/** > - * Find the sfile for the current parameters. Note that is required > - * that the PC value be set appropriately (needed for kernel images) > - */ > -struct sfile * sfile_find(struct transient const * trans); > - > -/** Log the sample in a previously located sfile. */ > -void sfile_log_sample(struct transient const * trans); > - > -/** Log the event/cycle count in a previously located sfile */ > -void sfile_log_sample_count(struct transient const * trans, > - unsigned long int count); > - > -/** initialise hashes */ > -void sfile_init(void); > - > -#endif /* OPD_SFILE_H */ > diff --git a/daemon/opd_spu.c b/daemon/opd_spu.c > deleted file mode 100644 > index 62a2c2b..0000000 > --- a/daemon/opd_spu.c > +++ /dev/null > @@ -1,176 +0,0 @@ > -/** > - * @file daemon/opd_spu.c > - * Processing the sample buffer for Cell BE SPU profile > - * > - * @remark Copyright 2007 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Maynard Johnson > - * (C) Copyright IBM Corporation 2007 > - */ > - > -#include "opd_interface.h" > -#include "opd_printf.h" > -#include "opd_sfile.h" > -#include "opd_stats.h" > -#include "opd_trans.h" > -#include "op_libiberty.h" > - > -#include <stdlib.h> > -#include <stdio.h> > - > -struct spu_context_info { > - pid_t tid; > - pid_t tgid; > - cookie_t app_cookie; > - uint64_t embedded_offset; > - cookie_t spu_cookie; > -}; > - > -static struct spu_context_info * spu_context_cache; > - > -/* Forward declaration */ > -static void process_spu_samples(struct transient * trans); > - > -void (*special_processor)(struct transient *); > - > -/* > - * This function is called when the first value found in the > - * buffer (after the beginning ESCAPE_CODE) is SPU_PROFILING_CODE. > - * Once we get here, the rest of the processing of the buffer is > - * Cell-SPU-specific, so we do not need to return until the > - * trans.buffer is empty. > - */ > -void code_spu_profiling(struct transient * trans) > -{ > - /* Next value in buffer is the number of SPUs. */ > - unsigned long long num_spus = pop_buffer_value(trans); > - /* Free the cache from previous run */ > - free(spu_context_cache); > - spu_context_cache = xmalloc(sizeof(struct spu_context_info) * num_spus); > - special_processor = process_spu_samples; > - process_spu_samples(trans); > -} > - > -void code_spu_ctx_switch(struct transient * trans) > -{ > - clear_trans_current(trans); > - > - if (!enough_remaining(trans, 6)) { > - trans->remaining = 0; > - return; > - } > - > - /* First value in the buffer for an SPU context switch is > - * the SPU number. For SPU profiling, 'cpu' = 'spu'. > - */ > - trans->cpu = pop_buffer_value(trans); > - trans->tid = pop_buffer_value(trans); > - trans->tgid = pop_buffer_value(trans); > - trans->app_cookie = pop_buffer_value(trans); > - > - if (vmisc) { > - char const * app = find_cookie(trans->app_cookie); > - printf("SPU_CTX_SWITCH to tid %lu, tgid %lu, cookie %llx(%s)\n", > - (unsigned long)trans->tid, (unsigned long)trans->tgid, > - trans->app_cookie, app ? app : "none"); > - } > - > - /* The trans->cookie will point to the binary file where the SPU ELF > - * can be found. If the SPU ELF is embedded, it may be embedded in > - * either the executable application binary or a shared lib. If shared > - * library, then trans->cookie will differ from the previously obtained > - * trans->app_cookie. For the non-embedded case, trans->cookie always > - * points to a separate binary file. > - */ > - trans->cookie = pop_buffer_value(trans); > - trans->embedded_offset = pop_buffer_value(trans); > -} > - > - > -static void cache_spu_context_info(struct transient * trans) > -{ > - int i = trans->cpu; > - spu_context_cache[i].tid = trans->tid; > - spu_context_cache[i].tgid = trans->tgid; > - spu_context_cache[i].app_cookie = trans->app_cookie; > - spu_context_cache[i].embedded_offset = trans->embedded_offset; > - spu_context_cache[i].spu_cookie = trans->cookie; > -} > - > -static void update_trans_for_spu(struct transient * trans) > -{ > - int i = trans->cpu; > - trans->tid = spu_context_cache[i].tid; > - trans->tgid = spu_context_cache[i].tgid; > - trans->app_cookie = spu_context_cache[i].app_cookie; > - trans->embedded_offset = spu_context_cache[i].embedded_offset; > - trans->cookie = spu_context_cache[i].spu_cookie; > -} > -#define SPU_NUM_MASK 0xFFFFFFFF00000000ULL > -#define SPU_CYCLES_COUNTER 0 > - > -static void opd_put_spu_sample > -(struct transient * trans, unsigned long long pc) > -{ > - unsigned long spu_number = (pc & SPU_NUM_MASK) >> 32; > - if (trans->cpu != spu_number) { > - trans->cpu = spu_number; > - clear_trans_current(trans); > - update_trans_for_spu(trans); > - } > - /* get the current sfile if needed */ > - if (!trans->current) > - trans->current = sfile_find(trans); > - > - if (trans->tracing != TRACING_ON) > - trans->event = SPU_CYCLES_COUNTER; > - > - trans->pc = (pc & ~SPU_NUM_MASK); > - /* log the sample or arc */ > - sfile_log_sample(trans); > - > - /* switch to trace mode */ > - if (trans->tracing == TRACING_START) > - trans->tracing = TRACING_ON; > - > - update_trans_last(trans); > -} > - > -/* > - * This function processes SPU context switches and > - * SPU program counter samples. After processing a > - * context switch (via handlers[code)), we cache the > - * SPU context information that has been temporarily > - * stored in trans. > - */ > -static void process_spu_samples(struct transient * trans) > -{ > - unsigned long long code; > - trans->in_kernel = 0; > - while (trans->remaining) { > - code = pop_buffer_value(trans); > - > - if (!is_escape_code(code)) { > - opd_put_spu_sample(trans, code); > - continue; > - } > - > - if (!trans->remaining) { > - verbprintf(vmisc, "Dangling ESCAPE_CODE.\n"); > - opd_stats[OPD_DANGLING_CODE]++; > - break; > - } > - > - /* started with ESCAPE_CODE, next is type */ > - code = pop_buffer_value(trans); > - > - if (code >= LAST_CODE) { > - fprintf(stderr, "Unknown code %llu\n", code); > - abort(); > - } > - > - handlers[code](trans); > - cache_spu_context_info(trans); > - } > -} > diff --git a/daemon/opd_stats.c b/daemon/opd_stats.c > deleted file mode 100644 > index 8817a14..0000000 > --- a/daemon/opd_stats.c > +++ /dev/null > @@ -1,92 +0,0 @@ > -/** > - * @file daemon/opd_stats.c > - * Management of daemon statistics > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#include "opd_stats.h" > -#include "opd_extended.h" > -#include "oprofiled.h" > - > -#include "op_get_time.h" > - > -#include <dirent.h> > -#include <stdlib.h> > -#include <stdio.h> > - > -unsigned long opd_stats[OPD_MAX_STATS]; > - > -/** > - * print_if - print an integer value read from file filename, > - * do nothing if the value read == -1 except if force is non-zero > - */ > -static void print_if(char const * fmt, char const * path, char const * filename, int force) > -{ > - int value = opd_read_fs_int(path, filename, 0); > - if (value != -1 || force) > - printf(fmt, value); > -} > - > -/** > - * opd_print_stats - print out latest statistics > - */ > -void opd_print_stats(void) > -{ > - DIR * dir; > - struct dirent * dirent; > - > - printf("\n%s\n", op_get_time()); > - printf("\n-- OProfile Statistics --\n"); > - printf("Nr. sample dumps: %lu\n", opd_stats[OPD_DUMP_COUNT]); > - printf("Nr. non-backtrace samples: %lu\n", opd_stats[OPD_SAMPLES]); > - printf("Nr. kernel samples: %lu\n", opd_stats[OPD_KERNEL]); > - printf("Nr. lost samples (no kernel/user): %lu\n", opd_stats[OPD_NO_CTX]); > - printf("Nr. lost kernel samples: %lu\n", opd_stats[OPD_LOST_KERNEL]); > - printf("Nr. incomplete code structs: %lu\n", opd_stats[OPD_DANGLING_CODE]); > - printf("Nr. samples lost due to sample file open failure: %lu\n", > - opd_stats[OPD_LOST_SAMPLEFILE]); > - printf("Nr. samples lost due to no permanent mapping: %lu\n", > - opd_stats[OPD_LOST_NO_MAPPING]); > - printf("Nr. user context kernel samples lost due to no app info available: %lu\n", > - opd_stats[OPD_NO_APP_KERNEL_SAMPLE]); > - print_if("Nr. samples lost due to buffer overflow: %u\n", > - "/dev/oprofile/stats", "event_lost_overflow", 1); > - print_if("Nr. samples lost due to no mapping: %u\n", > - "/dev/oprofile/stats", "sample_lost_no_mapping", 1); > - print_if("Nr. backtraces skipped due to no file mapping: %u\n", > - "/dev/oprofile/stats", "bt_lost_no_mapping", 0); > - print_if("Nr. samples lost due to no mm: %u\n", > - "/dev/oprofile/stats", "sample_lost_no_mm", 1); > - > - opd_ext_print_stats(); > - > - if (!(dir = opendir("/dev/oprofile/stats/"))) > - goto out; > - while ((dirent = readdir(dir))) { > - int cpu_nr; > - char path[256]; > - if (sscanf(dirent->d_name, "cpu%d", &cpu_nr) != 1) > - continue; > - snprintf(path, 256, "/dev/oprofile/stats/%s", dirent->d_name); > - > - printf("\n---- Statistics for cpu : %d\n", cpu_nr); > - print_if("Nr. samples lost cpu buffer overflow: %u\n", > - path, "sample_lost_overflow", 1); > - print_if("Nr. samples lost task exit: %u\n", > - path, "sample_lost_task_exit", 0); > - print_if("Nr. samples received: %u\n", > - path, "sample_received", 1); > - print_if("Nr. backtrace aborted: %u\n", > - path, "backtrace_aborted", 0); > - print_if("Nr. samples lost invalid pc: %u\n", > - path, "sample_invalid_eip", 0); > - } > - closedir(dir); > -out: > - fflush(stdout); > -} > diff --git a/daemon/opd_stats.h b/daemon/opd_stats.h > deleted file mode 100644 > index 5b703d6..0000000 > --- a/daemon/opd_stats.h > +++ /dev/null > @@ -1,32 +0,0 @@ > -/** > - * @file daemon/opd_stats.h > - * Management of daemon statistics > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#ifndef OPD_STATS_H > -#define OPD_STATS_H > - > -extern unsigned long opd_stats[]; > - > -enum { OPD_SAMPLES, /**< nr. samples */ > - OPD_KERNEL, /**< nr. kernel samples */ > - OPD_PROCESS, /**< nr. userspace samples */ > - OPD_NO_CTX, /**< nr. samples lost due to not knowing if in the kernel or not */ > - OPD_LOST_KERNEL, /**< nr. kernel samples lost */ > - OPD_LOST_SAMPLEFILE, /**< nr samples for which sample file can't be opened */ > - OPD_LOST_NO_MAPPING, /**< nr samples lost due to no mapping */ > - OPD_DUMP_COUNT, /**< nr. of times buffer is read */ > - OPD_DANGLING_CODE, /**< nr. partial code notifications (buffer overflow */ > - OPD_NO_APP_KERNEL_SAMPLE, /**<nr. user ctx kernel samples dropped due to no app cookie available */ > - OPD_MAX_STATS /**< end of stats */ > -}; > - > -void opd_print_stats(void); > - > -#endif /* OPD_STATS_H */ > diff --git a/daemon/opd_trans.c b/daemon/opd_trans.c > deleted file mode 100644 > index b279089..0000000 > --- a/daemon/opd_trans.c > +++ /dev/null > @@ -1,354 +0,0 @@ > -/** > - * @file daemon/opd_trans.c > - * Processing the sample buffer > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - * Modified by Aravind Menon for Xen > - * These modifications are: > - * Copyright (C) 2005 Hewlett-Packard Co. > - * > - * Modified by Maynard Johnson <[email protected]> > - * These modifications are: > - * (C) Copyright IBM Corporation 2007 > - */ > - > -#include "opd_trans.h" > -#include "opd_kernel.h" > -#include "opd_sfile.h" > -#include "opd_anon.h" > -#include "opd_stats.h" > -#include "opd_printf.h" > -#include "opd_interface.h" > - > -#include <limits.h> > -#include <string.h> > -#include <stdlib.h> > -#include <stdint.h> > -#include <stdio.h> > -#include <errno.h> > - > -extern size_t kernel_pointer_size; > - > - > -void clear_trans_last(struct transient * trans) > -{ > - trans->last = NULL; > - trans->last_anon = NULL; > -} > - > - > -void clear_trans_current(struct transient * trans) > -{ > - trans->current = NULL; > - trans->anon = NULL; > -} > - > - > -uint64_t pop_buffer_value(struct transient * trans) > -{ > - uint64_t val; > - > - if (!trans->remaining) { > - fprintf(stderr, "BUG: popping empty buffer !\n"); > - abort(); > - } > - > - if (kernel_pointer_size == 4) { > - uint32_t const * lbuf = (void const *)trans->buffer; > - val = *lbuf; > - } else { > - uint64_t const * lbuf = (void const *)trans->buffer; > - val = *lbuf; > - } > - > - trans->remaining--; > - trans->buffer += kernel_pointer_size; > - return val; > -} > - > - > -int enough_remaining(struct transient * trans, size_t size) > -{ > - if (trans->remaining >= size) > - return 1; > - > - verbprintf(vmisc, "Dangling ESCAPE_CODE.\n"); > - opd_stats[OPD_DANGLING_CODE]++; > - return 0; > -} > - > - > -static void opd_put_sample(struct transient * trans, unsigned long long pc) > -{ > - unsigned long long event; > - > - if (!enough_remaining(trans, 1)) { > - trans->remaining = 0; > - return; > - } > - > - event = pop_buffer_value(trans); > - > - if (trans->tracing != TRACING_ON) > - trans->event = event; > - > - trans->pc = pc; > - > - /* sfile can change at each sample for kernel */ > - if (trans->in_kernel != 0) > - clear_trans_current(trans); > - > - if (!trans->in_kernel && trans->cookie == NO_COOKIE) > - trans->anon = find_anon_mapping(trans); > - > - /* get the current sfile if needed */ > - if (!trans->current) > - trans->current = sfile_find(trans); > - > - /* > - * can happen if kernel sample falls through the cracks, or if > - * it's a sample from an anon region we couldn't find > - */ > - if (!trans->current) > - goto out; > - > - if (trans->tracing != TRACING_ON) { > - opd_stats[OPD_SAMPLES]++; > - opd_stats[trans->in_kernel == 1 ? OPD_KERNEL : OPD_PROCESS]++; > - } > - > - > - /* FIXME: this logic is perhaps too harsh? */ > - if (trans->current->ignored || (trans->last && trans->last->ignored)) > - goto out; > - > - /* log the sample or arc */ > - sfile_log_sample(trans); > - > -out: > - /* switch to trace mode */ > - if (trans->tracing == TRACING_START) > - trans->tracing = TRACING_ON; > - > - update_trans_last(trans); > -} > - > - > -static void code_unknown(struct transient * trans __attribute__((unused))) > -{ > - fprintf(stderr, "Unknown code !\n"); > - abort(); > -} > - > - > -static void code_ctx_switch(struct transient * trans) > -{ > - clear_trans_current(trans); > - > - if (!enough_remaining(trans, 5)) { > - trans->remaining = 0; > - return; > - } > - > - trans->tid = pop_buffer_value(trans); > - trans->app_cookie = pop_buffer_value(trans); > - /* must be ESCAPE_CODE, CTX_TGID_CODE, tgid. Like this > - * because tgid was added later in a compatible manner. > - */ > - pop_buffer_value(trans); > - pop_buffer_value(trans); > - trans->tgid = pop_buffer_value(trans); > - > - if (vmisc) { > - char const * app = find_cookie(trans->app_cookie); > - printf("CTX_SWITCH to tid %lu, tgid %lu, cookie %llx(%s)\n", > - (unsigned long)trans->tid, (unsigned long)trans->tgid, > - trans->app_cookie, app ? app : "none"); > - } > -} > - > - > -static void code_cpu_switch(struct transient * trans) > -{ > - clear_trans_current(trans); > - > - if (!enough_remaining(trans, 1)) { > - trans->remaining = 0; > - return; > - } > - > - trans->cpu = pop_buffer_value(trans); > - verbprintf(vmisc, "CPU_SWITCH to %lu\n", trans->cpu); > -} > - > - > -static void code_cookie_switch(struct transient * trans) > -{ > - clear_trans_current(trans); > - > - if (!enough_remaining(trans, 1)) { > - trans->remaining = 0; > - return; > - } > - > - trans->cookie = pop_buffer_value(trans); > - > - if (vmisc) { > - char const * name = verbose_cookie(trans->cookie); > - verbprintf(vmisc, "COOKIE_SWITCH to cookie %s(%llx)\n", > - name, trans->cookie); > - } > -} > - > - > -static void code_kernel_enter(struct transient * trans) > -{ > - verbprintf(vmisc, "KERNEL_ENTER_SWITCH to kernel\n"); > - trans->in_kernel = 1; > - clear_trans_current(trans); > - /* subtlety: we must keep trans->cookie cached, > - * even though it's meaningless for the kernel - > - * we won't necessarily get a cookie switch on > - * kernel exit. See comments in opd_sfile.c > - */ > -} > - > - > -static void code_user_enter(struct transient * trans) > -{ > - verbprintf(vmisc, "USER_ENTER_SWITCH to user-space\n"); > - trans->in_kernel = 0; > - clear_trans_current(trans); > - clear_trans_last(trans); > -} > - > - > -static void code_module_loaded(struct transient * trans __attribute__((unused))) > -{ > - verbprintf(vmodule, "MODULE_LOADED_CODE\n"); > - opd_reread_module_info(); > - clear_trans_current(trans); > - clear_trans_last(trans); > -} > - > - > -/* > - * This also implicitly signals the end of the previous > - * trace, so we never explicitly set TRACING_OFF when > - * processing a buffer. > - */ > -static void code_trace_begin(struct transient * trans) > -{ > - verbprintf(varcs, "TRACE_BEGIN\n"); > - trans->tracing = TRACING_START; > -} > - > -static void code_xen_enter(struct transient * trans) > -{ > - verbprintf(vmisc, "XEN_ENTER_SWITCH to xen\n"); > - trans->in_kernel = 1; > - trans->current = NULL; > - /* subtlety: we must keep trans->cookie cached, even though it's > - * meaningless for Xen - we won't necessarily get a cookie switch > - * on Xen exit. See comments in opd_sfile.c. It seems that we can > - * get away with in_kernel = 1 as long as we supply the correct > - * Xen image, and its address range in startup find_kernel_image > - * is modified to look in the Xen image also > - */ > -} > - > -extern void code_spu_profiling(struct transient * trans); > -extern void code_spu_ctx_switch(struct transient * trans); > - > -extern void code_ibs_fetch_sample(struct transient * trans); > -extern void code_ibs_op_sample(struct transient * trans); > - > -handler_t handlers[LAST_CODE + 1] = { > - &code_unknown, > - &code_ctx_switch, > - &code_cpu_switch, > - &code_cookie_switch, > - &code_kernel_enter, > - &code_user_enter, > - &code_module_loaded, > - /* tgid handled differently */ > - &code_unknown, > - &code_trace_begin, > - &code_unknown, > - &code_xen_enter, > -#if defined(__powerpc__) > - &code_spu_profiling, > - &code_spu_ctx_switch, > -#else > - &code_unknown, > - &code_unknown, > -#endif > - &code_ibs_fetch_sample, > - &code_ibs_op_sample, > -}; > - > -extern void (*special_processor)(struct transient *); > - > -void opd_process_samples(char const * buffer, size_t count) > -{ > - struct transient trans = { > - .buffer = buffer, > - .remaining = count, > - .tracing = TRACING_OFF, > - .current = NULL, > - .last = NULL, > - .cookie = INVALID_COOKIE, > - .app_cookie = INVALID_COOKIE, > - .anon = NULL, > - .last_anon = NULL, > - .pc = 0, > - .last_pc = 0, > - .event = 0, > - .in_kernel = -1, > - .cpu = -1, > - .tid = -1, > - .embedded_offset = UNUSED_EMBEDDED_OFFSET, > - .tgid = -1, > - .ext = NULL > - }; > - > - /* FIXME: was uint64_t but it can't compile on alpha where uint64_t > - * is an unsigned long and below the printf("..." %llu\n", code) > - * generate a warning, this look like a stopper to use c98 types :/ > - */ > - unsigned long long code; > - > - if (special_processor) { > - special_processor(&trans); > - return; > - } > - > - while (trans.remaining) { > - code = pop_buffer_value(&trans); > - > - if (!is_escape_code(code)) { > - opd_put_sample(&trans, code); > - continue; > - } > - > - if (!trans.remaining) { > - verbprintf(vmisc, "Dangling ESCAPE_CODE.\n"); > - opd_stats[OPD_DANGLING_CODE]++; > - break; > - } > - > - // started with ESCAPE_CODE, next is type > - code = pop_buffer_value(&trans); > - > - if (code >= LAST_CODE) { > - fprintf(stderr, "Unknown code %llu\n", code); > - abort(); > - } > - > - handlers[code](&trans); > - } > -} > diff --git a/daemon/opd_trans.h b/daemon/opd_trans.h > deleted file mode 100644 > index c0a868b..0000000 > --- a/daemon/opd_trans.h > +++ /dev/null > @@ -1,86 +0,0 @@ > -/** > - * @file daemon/opd_trans.h > - * Processing the sample buffer > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - * > - * Modified by Maynard Johnson <[email protected]> > - * These modifications are: > - * (C) Copyright IBM Corporation 2007 > - */ > - > -#ifndef OPD_TRANS_H > -#define OPD_TRANS_H > - > -#include "opd_cookie.h" > -#include "op_types.h" > - > -#include <stdint.h> > - > -struct sfile; > -struct anon_mapping; > - > -enum tracing_type { > - TRACING_OFF, > - TRACING_START, > - TRACING_ON > -}; > - > -/** > - * Transient values used for parsing the event buffer. > - * Note that these are reset for each buffer read, but > - * that should be ok as in the kernel, cpu_buffer_reset() > - * ensures that a correct context starts off the buffer. > - */ > -struct transient { > - char const * buffer; > - size_t remaining; > - enum tracing_type tracing; > - struct sfile * current; > - struct sfile * last; > - struct anon_mapping * anon; > - struct anon_mapping * last_anon; > - cookie_t cookie; > - cookie_t app_cookie; > - vma_t pc; > - vma_t last_pc; > - unsigned long event; > - int in_kernel; > - unsigned long cpu; > - pid_t tid; > - pid_t tgid; > - uint64_t embedded_offset; > - void * ext; > -}; > - > -typedef void (*handler_t)(struct transient *); > -extern handler_t handlers[]; > - > -uint64_t pop_buffer_value(struct transient * trans); > -int enough_remaining(struct transient * trans, size_t size); > -static inline void update_trans_last(struct transient * trans) > -{ > - trans->last = trans->current; > - trans->last_anon = trans->anon; > - trans->last_pc = trans->pc; > -} > - > -extern size_t kernel_pointer_size; > -static inline int is_escape_code(uint64_t code) > -{ > - return kernel_pointer_size == 4 ? code == ~0LU : code == ~0LLU; > -} > - > -void opd_process_samples(char const * buffer, size_t count); > - > -/** used when we need to clear data that's been freed */ > -void clear_trans_last(struct transient * trans); > - > -/** used when we need to clear data that's been freed */ > -void clear_trans_current(struct transient * trans); > - > -#endif /* OPD_TRANS_H */ > diff --git a/daemon/oprofiled.c b/daemon/oprofiled.c > deleted file mode 100644 > index 9d6d85c..0000000 > --- a/daemon/oprofiled.c > +++ /dev/null > @@ -1,532 +0,0 @@ > -/** > - * @file daemon/oprofiled.c > - * Initialisation and setup > - * > - * @remark Copyright 2002, 2003 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - * Modified by Aravind Menon for Xen > - * These modifications are: > - * Copyright (C) 2005 Hewlett-Packard Co. > - */ > - > -#include "config.h" > - > -#include "oprofiled.h" > -#include "opd_printf.h" > -#include "opd_events.h" > -#include "opd_extended.h" > - > -#include "op_config.h" > -#include "op_version.h" > -#include "op_hw_config.h" > -#include "op_libiberty.h" > -#include "op_file.h" > -#include "op_abi.h" > -#include "op_string.h" > -#include "op_cpu_type.h" > -#include "op_popt.h" > -#include "op_lockfile.h" > -#include "op_list.h" > -#include "op_fileio.h" > - > -#include <sys/types.h> > -#include <sys/resource.h> > -#include <stdlib.h> > -#include <fcntl.h> > -#include <stdio.h> > -#include <string.h> > -#include <unistd.h> > -#include <errno.h> > -#include <assert.h> > -#include <dirent.h> > -#include <limits.h> > - > -sig_atomic_t signal_alarm; > -sig_atomic_t signal_hup; > -sig_atomic_t signal_term; > -sig_atomic_t signal_child; > -sig_atomic_t signal_usr1; > -sig_atomic_t signal_usr2; > - > -uint op_nr_counters; > -op_cpu cpu_type; > -int no_event_ok; > -int vsfile; > -int vsamples; > -int varcs; > -int vmodule; > -int vmisc; > -int vext; > -int separate_lib; > -int separate_kernel; > -int separate_thread; > -int separate_cpu; > -int no_vmlinux; > -char * vmlinux; > -char * kernel_range; > -char * session_dir; > -int no_xen; > -char * xenimage; > -char * xen_range; > -static char * verbose; > -static char * binary_name_filter; > -static char * events; > -static char * ext_feature; > -static int showvers; > -static struct oprofiled_ops * opd_ops; > -extern struct oprofiled_ops opd_26_ops; > - > -#define OPD_IMAGE_FILTER_HASH_SIZE 32 > -static struct list_head images_filter[OPD_IMAGE_FILTER_HASH_SIZE]; > - > -static struct poptOption options[] = { > - { "session-dir", 0, POPT_ARG_STRING, &session_dir, 0, "place sample database in dir instead of default location", "/var/lib/oprofile", }, > - { "kernel-range", 'r', POPT_ARG_STRING, &kernel_range, 0, "Kernel VMA range", "start-end", }, > - { "vmlinux", 'k', POPT_ARG_STRING, &vmlinux, 0, "vmlinux kernel image", "file", }, > - { "no-vmlinux", 0, POPT_ARG_NONE, &no_vmlinux, 0, "vmlinux kernel image file not available", NULL, }, > - { "xen-range", 0, POPT_ARG_STRING, &xen_range, 0, "Xen VMA range", "start-end", }, > - { "xen-image", 0, POPT_ARG_STRING, &xenimage, 0, "Xen image", "file", }, > - { "image", 0, POPT_ARG_STRING, &binary_name_filter, 0, "image name filter", "profile these comma separated image" }, > - { "separate-lib", 0, POPT_ARG_INT, &separate_lib, 0, "separate library samples for each distinct application", "[0|1]", }, > - { "separate-kernel", 0, POPT_ARG_INT, &separate_kernel, 0, "separate kernel samples for each distinct application", "[0|1]", }, > - { "separate-thread", 0, POPT_ARG_INT, &separate_thread, 0, "thread-profiling mode", "[0|1]" }, > - { "separate-cpu", 0, POPT_ARG_INT, &separate_cpu, 0, "separate samples for each CPU", "[0|1]" }, > - { "events", 'e', POPT_ARG_STRING, &events, 0, "events list", "[events]" }, > - { "version", 'v', POPT_ARG_NONE, &showvers, 0, "show version", NULL, }, > - { "verbose", 'V', POPT_ARG_STRING, &verbose, 0, "be verbose in log file", "all,sfile,arcs,samples,module,misc", }, > - { "ext-feature", 'x', POPT_ARG_STRING, &ext_feature, 1, "enable extended feature", "<extended-feature-name>:[args]", }, > - POPT_AUTOHELP > - { NULL, 0, 0, NULL, 0, NULL, NULL, }, > -}; > - > - > -void opd_open_logfile(void) > -{ > - if (open(op_log_file, O_WRONLY|O_CREAT|O_NOCTTY|O_APPEND, 0644) == -1) { > - perror("oprofiled: couldn't re-open stdout: "); > - exit(EXIT_FAILURE); > - } > - > - if (dup2(1, 2) == -1) { > - perror("oprofiled: couldn't dup stdout to stderr: "); > - exit(EXIT_FAILURE); > - } > -} > - > - > -/** > - * opd_fork - fork and return as child > - * > - * fork() and exit the parent with _exit(). > - * Failure is fatal. > - */ > -static void opd_fork(void) > -{ > - switch (fork()) { > - case -1: > - perror("oprofiled: fork() failed: "); > - exit(EXIT_FAILURE); > - break; > - case 0: > - break; > - default: > - /* parent */ > - _exit(EXIT_SUCCESS); > - break; > - } > -} > - > - > -static void opd_go_daemon(void) > -{ > - opd_fork(); > - > - if (chdir(op_session_dir)) { > - fprintf(stderr, "oprofiled: opd_go_daemon: couldn't chdir to %s: %s", > - op_session_dir, strerror(errno)); > - exit(EXIT_FAILURE); > - } > - > - if (setsid() < 0) { > - perror("oprofiled: opd_go_daemon: couldn't setsid: "); > - exit(EXIT_FAILURE); > - } > - > - opd_fork(); > -} > - > - > -static void opd_write_abi(void) > -{ > - char * cbuf; > - > - cbuf = xmalloc(strlen(op_session_dir) + 5); > - strcpy(cbuf, op_session_dir); > - strcat(cbuf, "/abi"); > - op_write_abi_to_file(cbuf); > - free(cbuf); > -} > - > - > -/** > - * opd_alarm - sync files and report stats > - */ > -static void opd_alarm(int val __attribute__((unused))) > -{ > - signal_alarm = 1; > -} > - > - > -/* re-open logfile for logrotate */ > -static void opd_sighup(int val __attribute__((unused))) > -{ > - signal_hup = 1; > -} > - > - > -static void opd_sigterm(int val __attribute__((unused))) > -{ > - signal_term = 1; > -} > - > -static void opd_sigchild(int val __attribute__((unused))) > -{ > - signal_child = 1; > -} > - > - > -static void opd_sigusr1(int val __attribute__((unused))) > -{ > - signal_usr1 = 1; > -} > - > - > -static void opd_sigusr2(int val __attribute__((unused))) > -{ > - signal_usr2 = 1; > -} > - > - > -static void opd_setup_signals(void) > -{ > - struct sigaction act; > - > - act.sa_handler = opd_alarm; > - act.sa_flags = 0; > - sigemptyset(&act.sa_mask); > - > - if (sigaction(SIGALRM, &act, NULL)) { > - perror("oprofiled: install of SIGALRM handler failed: "); > - exit(EXIT_FAILURE); > - } > - > - act.sa_handler = opd_sighup; > - act.sa_flags = 0; > - sigemptyset(&act.sa_mask); > - sigaddset(&act.sa_mask, SIGALRM); > - > - if (sigaction(SIGHUP, &act, NULL)) { > - perror("oprofiled: install of SIGHUP handler failed: "); > - exit(EXIT_FAILURE); > - } > - > - act.sa_handler = opd_sigterm; > - act.sa_flags = 0; > - sigemptyset(&act.sa_mask); > - sigaddset(&act.sa_mask, SIGTERM); > - > - if (sigaction(SIGTERM, &act, NULL)) { > - perror("oprofiled: install of SIGTERM handler failed: "); > - exit(EXIT_FAILURE); > - } > - > - act.sa_handler = opd_sigchild; > - act.sa_flags = 0; > - sigemptyset(&act.sa_mask); > - sigaddset(&act.sa_mask, SIGCHLD); > - > - if (sigaction(SIGCHLD, &act, NULL)) { > - perror("oprofiled: install of SIGCHLD handler failed: "); > - exit(EXIT_FAILURE); > - } > - > - act.sa_handler = opd_sigusr1; > - act.sa_flags = 0; > - sigemptyset(&act.sa_mask); > - sigaddset(&act.sa_mask, SIGTERM); > - > - if (sigaction(SIGUSR1, &act, NULL)) { > - perror("oprofiled: install of SIGUSR1 handler failed: "); > - exit(EXIT_FAILURE); > - } > - > - act.sa_handler = opd_sigusr2; > - act.sa_flags = 0; > - sigemptyset(&act.sa_mask); > - sigaddset(&act.sa_mask, SIGTERM); > - > - if (sigaction(SIGUSR2, &act, NULL)) { > - perror("oprofiled: install of SIGUSR2 handler failed: "); > - exit(EXIT_FAILURE); > - } > -} > - > - > -struct opd_hashed_name { > - char * name; > - struct list_head next; > -}; > - > - > -static void add_image_filter(char const * name) > -{ > - size_t hash; > - struct opd_hashed_name * elt = xmalloc(sizeof(struct opd_hashed_name)); > - elt->name = xmalloc(PATH_MAX); > - if (!realpath(name, elt->name)) { > - free(elt->name); > - free(elt); > - return; > - } > - hash = op_hash_string(elt->name); > - verbprintf(vmisc, "Adding to image filter: \"%s\"\n", elt->name); > - list_add(&elt->next, &images_filter[hash % OPD_IMAGE_FILTER_HASH_SIZE]); > -} > - > - > -static void opd_parse_image_filter(void) > -{ > - size_t i; > - char const * last = binary_name_filter; > - char const * cur = binary_name_filter; > - > - if (!binary_name_filter) > - return; > - > - for (i = 0; i < OPD_IMAGE_FILTER_HASH_SIZE; ++i) > - list_init(&images_filter[i]); > - > - while ((cur = strchr(last, ',')) != NULL) { > - char * tmp = op_xstrndup(last, cur - last); > - add_image_filter(tmp); > - free(tmp); > - last = cur + 1; > - } > - add_image_filter(last); > -} > - > - > -int is_image_ignored(char const * name) > -{ > - size_t hash; > - struct list_head * pos; > - > - if (!binary_name_filter) > - return 0; > - > - hash = op_hash_string(name); > - > - list_for_each(pos, &images_filter[hash % OPD_IMAGE_FILTER_HASH_SIZE]) { > - struct opd_hashed_name * hashed_name = > - list_entry(pos, struct opd_hashed_name, next); > - if (!strcmp(hashed_name->name, name)) > - return 0; > - } > - > - return 1; > -} > - > - > -/** return the int in the given oprofilefs file */ > -int opd_read_fs_int(char const * path, char const * name, int fatal) > -{ > - char filename[PATH_MAX + 1]; > - snprintf(filename, PATH_MAX, "%s/%s", path, name); > - return op_read_int_from_file(filename, fatal); > -} > - > - > -static void opd_handle_verbose_option(char const * name) > -{ > - if (!strcmp(name, "all")) { > - vsfile = 1; > - vsamples = 1; > - varcs = 1; > - vmodule = 1; > - vmisc = 1; > - vext= 1; > - } else if (!strcmp(name, "sfile")) { > - vsfile = 1; > - } else if (!strcmp(name, "arcs")) { > - varcs = 1; > - } else if (!strcmp(name, "samples")) { > - vsamples = 1; > - } else if (!strcmp(name, "module")) { > - vmodule = 1; > - } else if (!strcmp(name, "misc")) { > - vmisc = 1; > - } else if (!strcmp(name, "ext")) { > - vext= 1; > - } else { > - fprintf(stderr, "unknown verbose options\n"); > - exit(EXIT_FAILURE); > - } > -} > - > -static void opd_parse_verbose(void) > -{ > - char const * last = verbose; > - char const * cur = verbose; > - > - if (!verbose) > - return; > - > - while ((cur = strchr(last, ',')) != NULL) { > - char * tmp = op_xstrndup(last, cur - last); > - opd_handle_verbose_option(tmp); > - free(tmp); > - last = cur + 1; > - } > - opd_handle_verbose_option(last); > -} > - > - > -static void opd_options(int argc, char const * argv[]) > -{ > - poptContext optcon; > - char * tmp; > - > - optcon = op_poptGetContext(NULL, argc, argv, options, 0); > - > - if (showvers) > - show_version(argv[0]); > - > - opd_parse_verbose(); > - > - if (separate_kernel) > - separate_lib = 1; > - > - cpu_type = op_get_cpu_type(); > - op_nr_counters = op_get_nr_counters(cpu_type); > - > - if (!no_vmlinux) { > - if (!vmlinux || !strcmp("", vmlinux)) { > - fprintf(stderr, "oprofiled: no vmlinux specified.\n"); > - poptPrintHelp(optcon, stderr, 0); > - exit(EXIT_FAILURE); > - } > - > - /* canonicalise vmlinux filename. fix #637805 */ > - tmp = xmalloc(PATH_MAX); > - if (realpath(vmlinux, tmp)) > - vmlinux = tmp; > - else > - free(tmp); > - > - if (!kernel_range || !strcmp("", kernel_range)) { > - fprintf(stderr, "oprofiled: no kernel VMA range specified.\n"); > - poptPrintHelp(optcon, stderr, 0); > - exit(EXIT_FAILURE); > - } > - } > - > - if(opd_ext_initialize(ext_feature) != EXIT_SUCCESS) > - exit(EXIT_FAILURE); > - > - if (events == NULL && no_event_ok == 0) { > - fprintf(stderr, "oprofiled: no events specified.\n"); > - poptPrintHelp(optcon, stderr, 0); > - exit(EXIT_FAILURE); > - } > - > - if (!xenimage || !strcmp("", xenimage)) { > - no_xen = 1; > - } else { > - no_xen = 0; > - > - /* canonicalise xen image filename. */ > - tmp = xmalloc(PATH_MAX); > - if (realpath(xenimage, tmp)) > - xenimage = tmp; > - else > - free(tmp); > - > - if (!xen_range || !strcmp("", xen_range)) { > - fprintf(stderr, "oprofiled: no Xen VMA range specified.\n"); > - poptPrintHelp(optcon, stderr, 0); > - exit(EXIT_FAILURE); > - } > - } > - > - if (events != NULL) > - opd_parse_events(events); > - > - opd_parse_image_filter(); > - > - poptFreeContext(optcon); > -} > - > - > -/* determine what kernel we're running and which daemon > - * to use > - */ > -static struct oprofiled_ops * get_ops(void) > -{ > - /* Support for 2.4 kernel was removed in oprofile 0.9.8, so > - * only "2.6" interface is supported. Later kernels also > - * comply with the 2.6 interface. > - */ > - switch (op_get_interface()) { > - case OP_INTERFACE_26: > - printf("Using 2.6+ OProfile kernel interface.\n"); > - return &opd_26_ops; > - default: > - break; > - } > - > - fprintf(stderr, "Couldn't determine kernel version.\n"); > - exit(EXIT_FAILURE); > - return NULL; > -} > - > - > -int main(int argc, char const * argv[]) > -{ > - int err; > - struct rlimit rlim = { 2048, 2048 }; > - > - opd_options(argc, argv); > - init_op_config_dirs(session_dir); > - > - opd_setup_signals(); > - > - err = setrlimit(RLIMIT_NOFILE, &rlim); > - if (err) > - perror("warning: could not set RLIMIT_NOFILE to 2048: "); > - > - opd_write_abi(); > - > - opd_ops = get_ops(); > - > - opd_ops->init(); > - > - opd_go_daemon(); > - > - /* clean up every 10 minutes */ > - alarm(60 * 10); > - > - if (op_write_lock_file(op_lock_file)) { > - fprintf(stderr, "oprofiled: could not create lock file %s\n", > - op_lock_file); > - exit(EXIT_FAILURE); > - } > - > - opd_ops->start(); > - > - opd_ops->exit(); > - > - return 0; > -} > diff --git a/daemon/oprofiled.h b/daemon/oprofiled.h > deleted file mode 100644 > index b319df1..0000000 > --- a/daemon/oprofiled.h > +++ /dev/null > @@ -1,69 +0,0 @@ > -/** > - * @file daemon/oprofiled.h > - * Initialisation and setup > - * > - * @remark Copyright 2002, 2003 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - * Modified by Aravind Menon for Xen > - * These modifications are: > - * Copyright (C) 2005 Hewlett-Packard Co. > - */ > - > -#ifndef OPROFILED_H > - > -#include <signal.h> > - > -struct oprofiled_ops { > - void (*init)(void); > - void (*start)(void); > - void (*exit)(void); > -}; > - > - > -/** > - * opd_open_logfile - open the log file > - * > - * Open the logfile on stdout and stderr. This function > - * assumes that 1 and 2 are the lowest close()d file > - * descriptors. Failure to open on either descriptor is > - * a fatal error. > - */ > -void opd_open_logfile(void); > - > - > -/** > - * is_image_ignored - check if we must ignore this image > - * @param name the name to check > - * > - * Return true if the image should not be profiled > - */ > -int is_image_ignored(char const * name); > - > -/** return the int in the given oprofilefs file, error is fatal if !is_fatal */ > -int opd_read_fs_int(char const * path, char const * name, int is_fatal); > - > - > -/** global variable positioned by signal handler */ > -extern sig_atomic_t signal_alarm; > -extern sig_atomic_t signal_hup; > -extern sig_atomic_t signal_term; > -extern sig_atomic_t signal_child; > -extern sig_atomic_t signal_usr1; > -extern sig_atomic_t signal_usr2; > - > -extern unsigned int op_nr_counters; > -extern int separate_lib; > -extern int separate_kernel; > -extern int separate_thread; > -extern int separate_cpu; > -extern int no_vmlinux; > -extern char * vmlinux; > -extern char * kernel_range; > -extern int no_xen; > -extern char * xenimage; > -extern char * xen_range; > - > -#endif /* OPROFILED_H */ > diff --git a/doc/Makefile.am b/doc/Makefile.am > index 258842f..43a7781 100644 > --- a/doc/Makefile.am > +++ b/doc/Makefile.am > @@ -10,13 +10,11 @@ STYLESHEETS=$(CHUNK_XHTML_STYLESHEET) $(srcdir)/xsl/xhtml-common.xsl > > man_MANS = \ > oprofile.1 \ > - opcontrol.1 \ > opreport.1 \ > opannotate.1 \ > opgprof.1 \ > ophelp.1 \ > op-check-perfevents.1 \ > - oprof_start.1 \ > oparchive.1 \ > opimport.1 > > diff --git a/doc/opannotate.1.in b/doc/opannotate.1.in > index a8f521c..e0ae1cd 100644 > --- a/doc/opannotate.1.in > +++ b/doc/opannotate.1.in > @@ -125,12 +125,11 @@ looking for them in --search-dirs. > .BI "--session-dir="dir_path > Use sample database from the specified directory > .I dir_path > -instead of the default locations. If > +instead of the default location. If > .I --session-dir > is not specified, then > .B opannotate > -will search for samples in > -.I <current_dir>/oprofile_data > +will search for samples in <current_dir>/oprofile_data > first. If that directory does not exist, the standard session-dir of /var/lib/oprofile is used. > .br > .TP > @@ -155,15 +154,9 @@ Show version. > No special environment variables are recognised by opannotate. > > .SH FILES > -.I <current_dir>/oprofile_data/samples > -.RS 7 > -Or > -.RE > -.I /var/lib/oprofile/samples/ > -.LP > -.RS 7 > +.TP > +.I <session_dir>/samples > The location of the generated sample files. > -.RE > > .SH VERSION > .TP > diff --git a/doc/oparchive.1.in b/doc/oparchive.1.in > index 0dba32d..753d6d5 100644 > --- a/doc/oparchive.1.in > +++ b/doc/oparchive.1.in > @@ -36,12 +36,11 @@ Give verbose debugging output. > .BI "--session-dir="dir_path > Use sample database from the specified directory > .I dir_path > -instead of the default locations. If > +instead of the default location. If > .I --session-dir > is not specified, then > .B oparchive > -will search for samples in > -.I <current_dir>/oprofile_data > +will search for samples in <current_dir>/oprofile_data > first. If that directory does not exist, the standard session-dir of /var/lib/oprofile is used. > .br > .TP > @@ -68,18 +67,12 @@ used --separate. > Only list the files that would be archived, don't copy them. > > .SH ENVIRONMENT > -No special environment variables are recognised by oparchive. > +No special environment variables are recognized by oparchive. > > .SH FILES > -.I <current_dir>/oprofile_data/samples > -.RS 7 > -Or > -.RE > -.I /var/lib/oprofile/samples/ > -.LP > -.RS 7 > +.TP > +.I <session_dir>/samples > The location of the generated sample files. > -.RE > > .SH VERSION > .TP > diff --git a/doc/opcontrol.1.in b/doc/opcontrol.1.in > deleted file mode 100644 > index 2418336..0000000 > --- a/doc/opcontrol.1.in > +++ /dev/null > @@ -1,198 +0,0 @@ > -.TH OPCONTROL 1 "@DATE@" "oprofile @VERSION@" > -.UC 4 > -.SH NAME > -opcontrol \- control OProfile profiling > -.SH SYNOPSIS > -.br > -.B opcontrol > -[ > -.I options > -] > -.SH DESCRIPTION > -.B opcontrol > -can be used to start profiling, end a profiling session, > -dump profile data, and set up the profiling parameters. > - > -.SH OPTIONS > -.TP > -.BI "--help / -?" > -Show help message. > -.br > -.TP > -.BI "--version / -v" > -Show version. > -.br > -.TP > -.BI "--list-events / -l" > -Shows the monitorable events. > -.br > -.TP > -.BI "--init" > -Load the OProfile module if required and make the OProfile driver > -interface available. > -.br > -.TP > -.BI "--setup" > -Followed by list options for profiling setup. Store setup > -in ~root/.oprofile/daemonrc. Optional. > -.br > -.TP > -.BI "--status" > -Show configuration information. > -.br > -.TP > -.BI "--start-daemon" > -Start the oprofile daemon without starting profiling. > -.br > -.TP > -.BI "--start / -s" > -Start data collection with either arguments provided by --setup > -or with information saved in ~root/.oprofile/daemonrc. > -.br > -.TP > -.BI "--dump / -d" > -Force a flush of the collected profiling data to the daemon. > -.br > -.TP > -.BI "--stop / -t" > -Stop data collection. > -.br > -.TP > -.BI "--shutdown / -h" > -Stop data collection and kill the daemon. > -.br > -.TP > -.BI "--reset" > -Clear out data from current session, but leaves saved sessions. > -.br > -.TP > -.BI "--save="sessionname > -Save data from current session to sessionname. > -.br > -.TP > -.BI "--deinit" > -Shut down daemon. Unload the oprofile module and oprofilefs. > -.br > -.TP > -.BI "--session-dir="dir_path > -Use sample database out of directory dir_path instead of the default location (/var/lib/oprofile). > -.br > -.TP > -.BI "--buffer-size="num > -Set kernel buffer to num samples. The buffer watershed needs > -to be tweaked when changing this value. > -Rules: A non-zero value goes into effect after a '--shutdown/start' sequence. > -A value of zero sets this parameter back to default value, but does not go into > -effect until after '--deinit/init' sequence. > -.br > -.TP > -.BI "--buffer-watershed="num > -Set kernel buffer watershed to num samples. When > -buffer-size - buffer-watershed free entries remain in the kernel buffer, data will be > -flushed to the daemon. Most useful values are in the range [0.25 - 0.5] * buffer-size. > -Same rules as defined for buffer-size. > -.br > -.TP > -.BI "--cpu-buffer-size="num > -Set kernel per-cpu buffer to num samples. If you profile at high > -rate it can help to increase this if the log file show excessive count of > -sample lost cpu buffer overflow. Same rules as defined for buffer-size. > -.br > -.TP > -.BI "--event / -e "[event|"default"] > -Specify an event to measure for the hardware performance counters, > -or "default" for the default event. The event is of the form > -"CPU_CLK_UNHALTED:30000:0:1:1" where the numeric values are > -count, unit mask, kernel-space counting, user-space counting, > -respectively. Note that this over-rides all previous events selected; > -if you want to profile with two or more events simultaneously, you must specify > -them on the same opcontrol invocation. You can specify unit mask values using either > -a numerical value (hex values > -.I must > -begin with "0x") or a symbolic name (if the > -.I name=<um_name> > -field is shown in the > -.B ophelp > -output). For some named unit masks, the hex value is not unique; thus, OProfile > -tools enforce specifying such unit masks value by name. > -.br > -.TP > -.BI "--separate / -p "[none,lib,kernel,thread,cpu,all] > -Separate samples based on the given separator. 'lib' separates > -dynamically linked library samples per application. 'kernel' separates > -kernel and kernel module samples per application; 'kernel' > -implies 'library'. 'thread' gives separation for each thread and > -task. 'cpu' separates for each CPU. 'all' implies all of the above > -options and 'none' turns off separation. > -.br > -.TP > -.BI "--callgraph / -c "[#depth] > -Enable callgraph sample collection with a maximum depth. Use 0 to disable > -callgraph profiling. This option is available on x86 using a > -2.6+ kernel with callgraph support enabled. It is also available on PowerPC using a 2.6.17+ kernel. > -.br > -.TP > -.BI "--image / -i "[name,name...|"all"] > -Only profile the given absolute paths to binaries, or "all" to profile > -everything (the default). > -.br > -.TP > -.BI "--vmlinux="file > -vmlinux kernel image. > -.br > -.TP > -.BI "--no-vmlinux" > -Use this when you don't have a kernel vmlinux file, and you don't want to > -profile the kernel. > -.br > -.TP > -.BI "--verbose / -V "[options] > -Be verbose in the daemon log. This has a high overhead. > -.br > -.TP > -.BI "--kernel-range="start,end > -Set kernel range vma address in hexadecimal. > - > -.SH OPTIONS (specific to Xen) > -.TP > -.BI "--xen="file > -Xen image > -.br > -.TP > -.BI "--active-domains="<list> > -List of domain ids participating in a multi-domain profiling session. If > -more than one domain is specified in <list> they should be separated using > -commas. This option can only be used in domain 0 which is the only domain > -that can coordinate a multi-domain profiling session. Including domain 0 in > -the list of active domains is optional. (e.g. --active-domains=2,5,6 and > ---active-domains=0,2,5,6 are equivalent) > -.br > -.SH OPTIONS (specific to System z) > -.TP > -.BI "--s390hwsampbufsize="num > -Number of 2MB areas used per CPU for storing sample data. The best > -size for the sample memory depends on the particular system and the > -workload to be measured. Providing the sampler with too little memory > -results in lost samples. Reserving too much system memory for the > -sampler impacts the overall performance and, hence, also the workload > -to be measured. > -.br > - > -.SH ENVIRONMENT > -No special environment variables are recognised by opcontrol. > - > -.SH FILES > -.TP > -.I /root/.oprofile/daemonrc > -Configuration file for opcontrol > -.TP > -.I /var/lib/oprofile/samples/ > -The location of the generated sample files. > - > -.SH VERSION > -.TP > -This man page is current for @PACKAGE@-@VERSION@. > - > -.SH SEE ALSO > -.BR @OP_DOCDIR@, > -.BR oprofile(1) > diff --git a/doc/operf.1.in b/doc/operf.1.in > index 3e441f3..efaceb9 100644 > --- a/doc/operf.1.in > +++ b/doc/operf.1.in > @@ -13,22 +13,22 @@ operf \- Performance profiler tool for Linux > [ --system-wide | --pid <pid> | [ command [ args ] ] ] > > .SH DESCRIPTION > -Operf is an OProfile tool that can be used in place of opcontrol for profiling. Operf > -uses the Linux Performance Events Subsystem, and hence, does not require the use of > -the opcontrol daemon -- in fact, operf and opcontrol usage are mutually exclusive. > +Operf is the profiler tool provided with OProfile. Operf > +uses the Linux Performance Events Subsystem and, thus, does not require the > +obsolete oprofile kernel driver. > .P > By default, operf uses <current_dir>/oprofile_data as the session-dir and stores profiling data there. > You can change this by way of the > .I --session-dir > -option. > -.P > -The usual post-profiling analysis tools such as > +option. The usual post-profiling analysis tools such as > .BI opreport(1) > and > .BI opannotate(1) > -can be used to generate profile reports. The post-processing analysis tools will search for samples in > -.I <current_dir>/oprofile_data > -first. If that directory does not exist, the post-processing tools use the standard session-dir of /var/lib/oprofile. > +can be used to generate profile reports. Unless a > +.I session-dir > +is specified, the post-processing analysis tools will search for samples in > +<current_dir>/oprofile_data first. If that directory does not exist, the > +post-processing tools use the standard session-dir of /var/lib/oprofile. > .P > Statistics, such as total samples received > and lost samples, are written to the operf.log file that can be found in the > diff --git a/doc/opgprof.1.in b/doc/opgprof.1.in > index 3e61ba9..5679289 100644 > --- a/doc/opgprof.1.in > +++ b/doc/opgprof.1.in > @@ -30,7 +30,14 @@ Give verbose debugging output. > .br > .TP > .BI "--session-dir="dir_path > -Use sample database out of directory dir_path instead of the default location (/var/lib/oprofile). > +Use sample database from the specified directory > +.I dir_path > +instead of the default location. If > +.I --session-dir > +is not specified, then > +.B opgprof > +will search for samples in <current_dir>/oprofile_data > +first. If that directory does not exist, the standard session-dir of /var/lib/oprofile is used. > .br > .TP > .BI "--image-path / -p [paths]" > @@ -51,11 +58,11 @@ of total samples. > Output to the given file instead of the default, gmon.out > > .SH ENVIRONMENT > -No special environment variables are recognised by opgprof. > +No special environment variables are recognized by opgprof. > > .SH FILES > .TP > -.I /var/lib/oprofile/samples/ > +.I <session_dir>/samples > The location of the generated sample files. > > .SH VERSION > diff --git a/doc/ophelp.1.in b/doc/ophelp.1.in > index 083cc85..3d4a7de 100644 > --- a/doc/ophelp.1.in > +++ b/doc/ophelp.1.in > @@ -67,9 +67,6 @@ No special environment variables are recognised by ophelp. > .TP > .I $prefix/share/oprofile/ > Event description files used by OProfile. > -.TP > -.I /var/lib/oprofile/samples/ > -The location of the generated sample files. > > .SH VERSION > .TP > diff --git a/doc/opimport.1.in b/doc/opimport.1.in > index ef8ef5c..5bb59b8 100644 > --- a/doc/opimport.1.in > +++ b/doc/opimport.1.in > @@ -43,11 +43,11 @@ Give verbose debugging output. > Show version. > > .SH ENVIRONMENT > -No special environment variables are recognised by opimport > +No special environment variables are recognized by opimport > > .SH FILES > .TP > -.I /var/lib/oprofile/abi > +.I <session_dir>/abi > The abi file description of the sample database files > > .SH VERSION > diff --git a/doc/opreport.1.in b/doc/opreport.1.in > index 46acf02..39374c4 100644 > --- a/doc/opreport.1.in > +++ b/doc/opreport.1.in > @@ -92,12 +92,11 @@ Reverse the sort from the default. > .BI "--session-dir="dir_path > Use sample database from the specified directory > .I dir_path > -instead of the default locations. If > +instead of the default location. If > .I --session-dir > is not specified, then > .B opreport > -will search for samples in > -.I <current_dir>/oprofile_data > +will search for samples in <current_dir>/oprofile_data > first. If that directory does not exist, the standard session-dir of /var/lib/oprofile is used. > .br > .TP > @@ -149,15 +148,9 @@ Generate XML output. > No special environment variables are recognized by opreport. > > .SH FILES > -.I <current_dir>/oprofile_data/samples > -.RS 7 > -Or > -.RE > -.I /var/lib/oprofile/samples/ > -.LP > -.RS 7 > +.TP > +.I <session_dir>/samples > The location of the generated sample files. > -.RE > > .SH VERSION > .TP > diff --git a/doc/oprof_start.1.in b/doc/oprof_start.1.in > deleted file mode 100644 > index 7307b5c..0000000 > --- a/doc/oprof_start.1.in > +++ /dev/null > @@ -1,43 +0,0 @@ > -.TH OPROF_START 1 "@DATE@" "oprofile @VERSION@" > -.UC 4 > -.SH NAME > -oprof_start \- A GUI interface for OProfile > -.SH SYNOPSIS > -.br > -.B oprof_start > -[ > -.I options > -] > -.SH DESCRIPTION > - > -The > -.B oprof_start > -application provides a GUI interface to control the operation of OProfile. > -Running > -.B oprof_start > -requires root privileges and does not support > -.B operf > -due to > -.B oprof_start > -using the older > -.B opcontrol > -script. > - > -.SH ENVIRONMENT > -No special environment variables are recognised by oprof_start. > - > -.SH FILES > -.TP > -.I /root/.oprofile/daemonrc > -Configuration file for opcontrol > -.TP > -.I /var/lib/oprofile/samples/ > -The location of the generated sample files. > - > -.SH VERSION > -.TP > -This man page is current for @PACKAGE@-@VERSION@. > - > -.SH SEE ALSO > -.BR @OP_DOCDIR@, > -.BR oprofile(1) > diff --git a/doc/oprofile.1.in b/doc/oprofile.1.in > index 0f2cb83..98589a9 100644 > --- a/doc/oprofile.1.in > +++ b/doc/oprofile.1.in > @@ -4,11 +4,6 @@ > oprofile \- a system-wide profiler > .SH SYNOPSIS > .br > -.B opcontrol > -[ > -.I options > -] > -.br > .B opreport > [ > .I options > @@ -44,10 +39,6 @@ OProfile can profile the whole system in high detail. > For a gentle guide to using OProfile, please read the HTML documentation > listed in SEE ALSO. > .br > -.SH OPCONTROL > -.B opcontrol > -is used for starting and stopping the OProfile daemon, and providing set-up > -parameters. > .SH OPREPORT > .B opreport > gives image and symbol-based profile summaries for the whole system or > @@ -150,20 +141,8 @@ No special environment variables are recognised by oprofile. > .I $HOME/.oprofile/ > Configuration files > .TP > -.I /root/.oprofile/daemonrc > -Configuration file for opcontrol > -.TP > .I @prefix@/share/oprofile/ > Event description files used by OProfile. > -.TP > -.I /var/lib/oprofile/samples/oprofiled.log > -The user-space daemon logfile. > -.TP > -.I /dev/oprofile > -The device filesystem for communication with the Linux kernel module. > -.TP > -.I /var/lib/oprofile/samples/ > -The location of the generated sample files. > > .SH VERSION > .TP > @@ -171,7 +150,6 @@ This man page is current for @PACKAGE@-@VERSION@. > > .SH SEE ALSO > .BR @OP_DOCDIR@, > -.BR opcontrol(1), > .BR opreport(1), > .BR opannotate(1), > .BR oparchive(1), > diff --git a/doc/oprofile.xml b/doc/oprofile.xml > index dfa8239..50d5471 100644 > --- a/doc/oprofile.xml > +++ b/doc/oprofile.xml > @@ -3,7 +3,7 @@ > <book id="oprofile-guide"> > <bookinfo> > <title>OProfile manual</title> > - > + > <authorgroup> > <author> > <firstname>John</firstname> > @@ -48,50 +48,41 @@ cache misses, or CPU cycles. OProfile can collect profiles of code based on the > repeatedly, every time a certain (configurable) number of events has occurred, the PC value is recorded. > This information is aggregated into profiles for each binary image. Alternatively, OProfile's event counting > tool can collect simple raw event counts.</para> > -<para> > -Some hardware setups do not allow OProfile to use performance counters: in these cases, no > -events are available so OProfile operates in timer mode, as described in later chapters. Timer > -mode is only available in "legacy profiling mode" (see <xref linkend="legacy_mode"/>). > -</para> > <sect1 id="legacy_mode"> > <title>OProfile legacy profiling mode</title> > -"Legacy" OProfile consists of the <command>opcontrol</command> shell script, the <command>oprofiled</command> daemon, and several post-processing tools (e.g., > -<command>opreport</command>). The <command>opcontrol</command> script is used for configuring, starting, and stopping a profiling session. An OProfile > -kernel driver (usually built as a kernel module) is used for collecting samples, which are then recorded into sample files by > -<command>oprofiled</command>. Using OProfile in "legacy mode" requires root user authority since the profiling is done on a system-wide basis, which may > -(if misused) cause adverse effects to the system. > -<note> > -Profiling setup parameters that you specify using <command>opcontrol</command> are cached in <filename>/root/.oprofile/daemonrc</filename>. > -Subsequent runs of <code>opcontrol --start</code> will continue to use these cached values until you > -override them with new values. > -</note> > +Prior to release 1.0, OProfile included a profiling tool consisting of the <command>opcontrol</command> shell script, the <command>oprofiled</command> daemon, > +and the attendant oprofile kernel driver. This "legacy profiler" was deprecated in release 0.9.8 with the introduction of > +the <command>operf</command> profiling tool (see <xref linkend="perf_events"/>). Some older architectures/platforms > +do not support the use of <command>operf</command>. For those cases, oprofile users should install release 0.9.9, which is the > +last release to include the legacy profiler. > </sect1> > <sect1 id="perf_events"> > <title>OProfile perf_events profiling mode</title> > -As of release 0.9.8, OProfile now includes the ability to profile a single process versus the system-wide technique > -of legacy OProfile. With this new technique, the <command>operf</command> program is used to control profiling instead of the > -<command>opcontrol</command> script and <command>oprofiled</command> daemon of leagacy mode. Also, <command>operf</command> does not require the > -special OProfile kernel driver that legacy mode does; instead, it interfaces with the kernel to collect samples via the Linux Kernel > -Performance Events Subsystem (hereafter referred to as "perf_events"). Using <command>operf</command> to profile a single > -process can be done as a normal user; however, root authority <emphasis>is</emphasis> required to run <command>operf</command> in system-wide > -profiling mode. > -<note> > -<title>Note 1</title> > -The same OProfile post-processing tools are used whether you collect your profile with <command>operf</command> or <command>opcontrol</command>. > -</note> > +<para> > +OProfile has the ability to profile a single process or every currently running process (i.e., system-wide) > +via the <command>operf</command> program. <command>operf</command> interfaces with the > +kernel to collect samples via the Linux Kernel Performance Events Subsystem (hereafter > +referred to as "perf_events"). OProfile can co-exist with other tools on your system that > +may also be using the perf_events kernel subsystem. > +</para> > +<para> > +Using <command>operf</command> to profile a single > +process can be done as a normal user; however, root authority <emphasis>is</emphasis> required to run > +<command>operf</command> in system-wide profiling mode. > <note> > -<title>Note 2</title> > +<title>Note</title> > Some older processor models are not supported by the underlying perf_events kernel and, thus, are not supported by <command>operf</command>. > If you receive the message > <screen> Your kernel's Performance Events Subsystem does not support your processor type</screen> > -when attempting to use <command>operf</command>, try profiling with <command>opcontrol</command> > +when attempting to use <command>operf</command>, install OProfile 0.9.9 and try profiling with <command>opcontrol</command> > to see if your processor type may be supported by OProfile's legacy mode. > </note> > +</para> > </sect1> > > <sect1 id="event_counting"> > <title>OProfile event counting mode</title> > -As of release 0.9.9, OProfile now includes the <command>ocount</command> tool which provides the capability of > +OProfile provides the <command>ocount</command> tool for > collecting raw event counts on a per-application, per-process, per-cpu, or system-wide basis. Unlike the > profiling tools, post-processing of the data collected is not necessary -- the data is displayed in the > output of <command>ocount</command>. A common use case for event counting tools is when performance analysts > @@ -132,33 +123,30 @@ OProfile is not a panacea. OProfile might not be a complete solution when you : > <sect2 id="jitsupport"> > <title>Support for dynamically compiled (JIT) code</title> > <para> > -Older versions of OProfile were not capable of attributing samples to symbols from dynamically > -compiled code, i.e. "just-in-time (JIT) code". Typical JIT compilers load the JIT code into > -anonymous memory regions. OProfile reported the samples from such code, but the attribution > -provided was simply: > -<screen> anon: <tgid><address range></screen> > -Due to this limitation, it wasn't possible to profile applications executed by virtual machines (VMs) > -like the Java Virtual Machine. OProfile now contains an infrastructure to support JITed code. > +OProfile provides a framework to support JITed code ("just-in-time (JIT) compiled code"). > A development library is provided to allow developers > -to add support for any VM that produces dynamically compiled code (see the <emphasis>OProfile JIT agent > +to add support for any VM (virtual machine) that produces dynamically compiled code (see the <emphasis>OProfile JIT agent > developer guide</emphasis>). > In addition, built-in support is included for the following:</para> > <itemizedlist><listitem>JVMTI agent library for Java (1.5 and higher)</listitem> > <listitem>JVMPI agent library for Java (1.5 and lower)</listitem> > </itemizedlist> > -<para> > +These libraries make it possible for OProfile to attribute profile samples > +to Java methods. Without a VM-specific agent library, OProfile will typically report > +samples from JITed code similar to the following example: > +<screen> anon: <tgid><address range></screen> > For information on how to use OProfile's JIT support, see <xref linkend="setup-jit"/>. > -</para> > </sect2> > > <sect2 id="guestsupport"> > <title>No support for virtual machine guests</title> > <para> > OProfile currently does not support event-based profiling (i.e, using hardware events like cache misses, > -branch mispredicts) on virtual machine guests running under systems such as VMware. The list of > -supported events displayed by ophelp or 'opcontrol --list-events' is based on CPU type and does > +branch mispredicts) on virtual machine guests running under systems such as VMware. > +(Note: KVM guests <emphasis>are</emphasis> supported.) The list of > +supported events displayed by ophelp is based on CPU type and does > not take into account whether the running system is a guest system or real system. To use > -OProfile on such guest systems, you can use timer mode (see <xref linkend="timer" />). > +OProfile on such guest systems, you must use the legacy profiler's timer mode (see <xref linkend="timer" />). > </para> > </sect2> > > @@ -172,47 +160,13 @@ OProfile on such guest systems, you can use timer mode (see <xref linkend="timer > <varlistentry> > <term>Linux kernel</term> > <listitem><para> > - To use OProfile's JIT support, a kernel version 2.6.13 or later is required. > - In earlier kernel versions, the anonymous memory regions are not reported to OProfile and results > - in profiling reports without any samples in these regions. > - </para> > - > - <para> > - Profiling the Cell Broadband Engine PowerPC Processing Element (PPE) requires a kernel version > - of 2.6.18 or more recent. > - Profiling the Cell Broadband Engine Synergistic Processing Element (SPE) requires a kernel version > - of 2.6.22 or more recent. Additionally, full support of SPE profiling requires a BFD library > - from binutils code dated January 2007 or later. To ensure the proper BFD support exists, run > - the <code>configure</code> utility with <code>--with-target=cell-be</code>. > - > - Profiling the Cell Broadband Engine using SPU events requires a kernel version of 2.6.29-rc1 > - or more recent. > - > - <note>Attempting to profile SPEs with kernel versions older than 2.6.22 may cause the > - system to crash.</note> > - </para> > - > - <para> > - Instruction-Based Sampling (IBS) profile on AMD family10h processors requires > - kernel version 2.6.28-rc2 or later. > - </para> > - </listitem> > - </varlistentry> > - <varlistentry> > - <term>Supported architecture</term> > - <listitem><para> > - For Intel IA32, processors as old as P6 generation or Pentium 4 core are > - supported. The AMD Athlon, Opteron, Phenom, and Turion CPUs are also supported. > - Older IA32 CPU types can be used with the timer mode of OProfile; please > - see later in this manual for details. OProfile also supports most processor > - types of the following architectures: Alpha, MIPS, ARM, x86-64, sparc64, PowerPC, > - AVR32, and, in timer mode, PA-RISC and s390. > + Release 2.6.31 or higher > </para></listitem> > </varlistentry> > <varlistentry> > - <term>Uniprocessor or SMP</term> > + <term>Supported architectures</term> > <listitem><para> > - SMP machines are fully supported. > + AMD, ARM, Intel, PowerPC, Tile, MIPS > </para></listitem> > </varlistentry> > <varlistentry> > @@ -226,8 +180,7 @@ OProfile on such guest systems, you can use timer mode (see <xref linkend="timer > <varlistentry> > <term>Required kernel headers</term> > <listitem><para> > - In order to build the perf_events-enabled <command>operf</command> program, you need to either > - install the kernel-headers package for your system or use the <code>--with-kernel</code> > + Either the kernel-headers package must be installed or use the <code>--with-kernel</code> > configure option. > </para></listitem> > </varlistentry> > @@ -245,13 +198,6 @@ OProfile on such guest systems, you can use timer mode (see <xref linkend="timer > </para></listitem> > </varlistentry> > <varlistentry> > - <term>OProfile GUI</term> > - <listitem><para> > - The use of the GUI to start the profiler requires the <filename>Qt</filename> library. > - Either <filename>Qt 3</filename> or <filename>Qt 4</filename> should work. > - </para></listitem> > - </varlistentry> > - <varlistentry> > <term><acronym>ELF</acronym></term> > <listitem><para> > Probably not too strenuous a requirement, but older <acronym>A.OUT</acronym> binaries/libraries are not supported. > @@ -298,7 +244,7 @@ OProfile on such guest systems, you can use timer mode (see <xref linkend="timer > <term>Bug tracker</term> > <listitem><para> > There is a bug tracker for OProfile at SourceForge, > - <ulink url="http://sf.net/tracker/?group_id=16191&atid=116191">http://sf.net/tracker/?group_id=16191&atid=116191</ulink>. > + <ulink url="http://sourceforge.net/p/oprofile/bugs/">http://sourceforge.net/p/oprofile/bugs/</ulink>. > </para></listitem> > </varlistentry> > <varlistentry> > @@ -408,11 +354,6 @@ time by providing the "lapic" option to the kernel. > If you use the NMI watchdog, be aware that the watchdog is disabled when profiling starts > and not re-enabled until the profiling is stopped. > </para> > -<para> > -Please note that you must save or have available the <filename>vmlinux</filename> file > -generated during a kernel compile, as OProfile needs it (you can use > -<option>--no-vmlinux</option>, but this will prevent kernel profiling). > -</para> > > </sect1> > > @@ -431,13 +372,8 @@ remove all installed files except your configuration file in the directory <file > <sect1 id="getting-started-with-operf"> > <title>Getting started with OProfile using <command>operf</command></title> > <para> > -Profiling with <command>operf</command> is the recommended profiling mode with OProfile. Using > -this mode not only allows you to target your profiling more precisely (i.e., single process > -or system-wide), it also allows OProfile to co-exist better with other tools on your system that > -may also be using the perf_events kernel subsystem. > -</para> > -<para> > -With <command>operf</command>, there is no initial setup needed -- simply invoke <command>operf</command> with > +Profiling with <command>operf</command> allows you to precisely target your profiling (i.e., single process > +or system-wide). With <command>operf</command>, there is no initial setup needed -- simply invoke <command>operf</command> with > the options you need; then run the OProfile post-processing tool(s). The <command>operf</command> syntax > is as follows: > </para> > @@ -455,63 +391,6 @@ unless you pass the <code>--session-dir</code> option. > </para> > </sect1> > > -<sect1 id="getting-started-with-legacy"> > -<title>Getting started with OProfile using legacy profiling mode</title> > -<para> > -Before you can use OProfile's legacy profiling mode, you must set it up. The minimum setup required for this > -is to tell OProfile where the <filename>vmlinux</filename> file corresponding to the > -running kernel is, for example : > -</para> > -<screen>opcontrol --vmlinux=/boot/vmlinux-`uname -r`</screen> > -<para> > -If you don't want to profile the kernel itself, > -you can tell OProfile you don't have a <filename>vmlinux</filename> file : > -</para> > -<screen>opcontrol --no-vmlinux</screen> > -<para> > -Now we are ready to start the daemon (<command>oprofiled</command>) which collects > -the profile data : > -</para> > -<screen>opcontrol --start</screen> > -<para> > -When you want to stop profiling, you can do so with : > -</para> > -<screen>opcontrol --shutdown</screen> > -<para> > -Note that unlike <command>gprof</command>, no instrumentation (<option>-pg</option> > -and <option>-a</option> options to <command>gcc</command>) > -is necessary. > -</para> > -<para> > -Periodically (or on <command>opcontrol --shutdown</command> or <command>opcontrol --dump</command>) > -the profile data is written out into the $SESSION_DIR/samples directory (by default at <filename>/var/lib/oprofile/samples</filename>). > -These profile files cover shared libraries, applications, the kernel (vmlinux), and kernel modules. > -You can clear the profile data (at any time) with <command>opcontrol --reset</command>. > -</para> > -<para> > -To place these sample database files in a specific directory instead of the default location > -(<filename>/var/lib/oprofile</filename>) use the <option>--session-dir=dir</option> option. > -You must also specify the <option>--session-dir</option> to tell the tools to continue using this directory. > -</para> > -<screen>opcontrol --no-vmlinux --session-dir=/home/me/tmpsession</screen> > -<screen>opcontrol --start --session-dir=/home/me/tmpsession</screen> > -<para> > -You can get summaries of this data in a number of ways at any time. To get a summary of > -data across the entire system for all of these profiles, you can do : > -</para> > -<screen>opreport [--session-dir=dir]</screen> > -<para> > -Or to get a more detailed summary, for a particular image, you can do something like : > -</para> > -<screen>opreport -l /boot/vmlinux-`uname -r`</screen> > -<para> > -There are also a number of other ways of presenting the data, as described later in this manual. > -Note that OProfile will choose a default profiling setup for you. However, there are a number > -of options you can pass to <command>opcontrol</command> if you need to change something, > -also detailed later. > -</para> > - > -</sect1> > > <sect1 id="getting-started-with-ocount"> > <title>Getting started with OProfile using <command>ocount</command></title> > @@ -533,7 +412,7 @@ stops and the results are displayed to the screen (as shown below). > <para> > <screen> > Events were actively counted for 2.8 seconds. > -Event counts (actual) for /home/user1/my_test_program my_arg: > +Event counts (actual) for /home/user1/my_test_program: > Event Count % time counted > CPU_CLK_UNHALTED 9,408,018,070 100.00 > INST_RETIRED 16,719,918,108 100.00 > @@ -545,13 +424,10 @@ Event counts (actual) for /home/user1/my_test_program my_arg: > <sect1 id="eventspec"> > <title>Specifying performance counter events</title> > <para> > -Both methods of profiling (<command>operf</command> and <command>opcontrol</command>) -- > -as well as event counting with <command>ocount</command> -- > -allow you to give one or more event specifications to provide details of how each > -hardware performance counter should be set up. With <command>operf</command> and <command>ocount</command>, you > -can provide a comma-separated list of event specfications using the <code>--events</code> > -option. With <command>opcontrol</command>, you use the <code>--event</code> option > -for each desired event specification. > +Whether profiling with <command>operf</command> or doing simple event counting with <command>ocount</command>, > +you can collect information about one more native hardware events using the <code>--events</code> > +option -- a comma-separated list of event specfications. The event specification is the means to provide details > +of how each hardware performance counter should be set up. > For profiling, the event specification is a colon-separated string of the form > <option><emphasis>name</emphasis>:<emphasis>count</emphasis>:<emphasis>unitmask</emphasis>:<emphasis>kernel</emphasis>:<emphasis>user</emphasis></option> > as described in the table below. For <command>ocount</command>, specification is of the form > @@ -561,19 +437,14 @@ how many events should occur between a profile snapshot (usually referred to as > <command>ocount</command> does not do sampling, the <emphasis>count</emphasis> field is not needed. > </para> > <para> > -If no event specs are passed to <command>operf</command>, <command>ocount</command>, or <command>opcontrol</command>, > -the default event will be used. With <command>opcontrol</command>, if you have > -previously specified some non-default event but want to revert to the default event, use > -<option>--event=default</option>. Use of this option overrides all previous event selections > -that have been cached. > +If no event specs are passed to <command>operf</command> or <command>ocount</command>, > +the default event will be used. > </para> > <para> > -<note>OProfile will allocate hardware counters as necessary, but some processor > +<note>The perf_events kernel subsystem allocates hardware counters as necessary, but some processor > types have restrictions as to what hardware events may be counted simultaneously. > -<command>operf</command> and <command>ocount</command> use a multiplexing technique when such > -hardware restrictions are encountered, but <command>opcontrol</command> does > -not have this capability; instead, <command>opcontrol</command> will display an > -error message if you select an incompatible set of events. > +The kernel employs a multiplexing technique when such > +hardware restrictions are encountered, such that events are monitored on a rotating basis. > </note> > </para> > <informaltable frame="all"> > @@ -583,15 +454,16 @@ error message if you select an incompatible set of events. > <row><entry><option>count</option></entry><entry>The counter reset value, e.g. 100000; use only for profiling</entry></row> > <row><entry><option>unitmask</option></entry><entry>The unit mask, as given in the events list: e.g. 0x0f; or a symbolic name > if a <constant>name=<um_name></constant> field is present</entry></row> > -<row><entry><option>kernel</option></entry><entry>Whether to profile kernel code</entry></row> > -<row><entry><option>user</option></entry><entry>Whether to profile userspace code</entry></row> > +<row><entry><option>kernel</option></entry><entry>Enable profiling of kernel code</entry></row> > +<row><entry><option>user</option></entry><entry>Enable profiling of userspace code</entry></row> > </tbody> > </tgroup> > </informaltable> > <para> > -The last three values are optional, if you omit them (e.g. <option>operf --events=DATA_MEM_REFS:30000</option>), > -they will be set to the default values (the default unit mask value for the given event, and profiling (or counting) > -both kernel and userspace code). Note that some events require a unit mask. > +The last three values are optional; if you omit them (e.g. <option>operf --events=DATA_MEM_REFS:30000</option>), > +they will be set to the default values (i.e., the default unit mask value for the given event, and profiling (or counting) > +both kernel and userspace code will be enabled). Note that on some architectures, some events may > +require a unit mask be specified. > </para> > <para> > You can specify unit mask values using either a numerical value (hex values > @@ -599,22 +471,6 @@ You can specify unit mask values using either a numerical value (hex values > field is shown in the <command>ophelp</command> output). For some named unit masks, the hex value is not unique; thus, OProfile > tools enforce specifying such unit masks value by name. > </para> > -<note><para> > -When using legacy mode <command>opcontrol</command> on IBM PowerPC platforms, all events specified must be in the same group; > -i.e., the group number appended to the event name (e.g. <constant><<emphasis>some-event-name</emphasis>>_GRP9 > -</constant>) must be the same. > -</para> > -<para> > -When using <command>operf</command> or <command>ocount</command> on IBM PowerPC platforms, the above restriction > -regarding the same group number does not apply, and events may be > -specified with or without the group number suffix. If no group number suffix is given, one will be automatically > -assigned; thus, OProfile post-processing tools will always show real event > -names that include the group number suffix. > -</para> > -</note> > -<para> > -If OProfile is using timer-interrupt mode, there is no event configuration possible. > -</para> > <para> > The table below lists the default profiling event for various processor types. The same events > can be used for <command>ocount</command>, minus the <emphasis>count</emphasis> field. > @@ -631,7 +487,6 @@ can be used for <command>ocount</command>, minus the <emphasis>count</emphasis> > <row><entry>ARM/XScale PMU1</entry><entry>arm/xscale1</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row> > <row><entry>ARM/XScale PMU2</entry><entry>arm/xscale2</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row> > <row><entry>ARM/MPCore</entry><entry>arm/mpcore</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row> > -<row><entry>AVR32</entry><entry>avr32</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row> > <row><entry>Athlon</entry><entry>i386/athlon</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row> > <row><entry>Pentium Pro</entry><entry>i386/ppro</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row> > <row><entry>Pentium II</entry><entry>i386/pii</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row> > @@ -642,12 +497,8 @@ can be used for <command>ocount</command>, minus the <emphasis>count</emphasis> > <row><entry>Hammer</entry><entry>x86-64/hammer</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row> > <row><entry>Family10h</entry><entry>x86-64/family10</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row> > <row><entry>Family11h</entry><entry>x86-64/family11h</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row> > -<row><entry>Itanium</entry><entry>ia64/itanium</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row> > -<row><entry>Itanium 2</entry><entry>ia64/itanium2</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row> > -<row><entry>TIMER_INT</entry><entry>timer</entry><entry>None selectable</entry></row> > -<row><entry>IBM pseries</entry><entry>PowerPC 4/5/6/7/8/970/Cell</entry><entry>CYCLES:100000:0:1:1</entry></row> > -<row><entry>IBM s390</entry><entry>timer</entry><entry>None selectable</entry></row> > -<row><entry>IBM s390x</entry><entry>timer</entry><entry>None selectable</entry></row> > +<row><entry>IBM pseries</entry><entry>ppc64/power{ 4|5|6|7|8|970 }</entry><entry>CYCLES:100000:0:1:1</entry></row> > +<row><entry>IBM s390</entry><entry>s390/{ z10|z196|zEC12 }</entry><entry>HWSAMPLING:4127518:0:1:1</entry></row> > </tbody> > </tgroup> > </informaltable> > @@ -670,14 +521,14 @@ This section gives a brief description of the available OProfile utilities and t > <varlistentry> > <term><filename>operf</filename></term> > <listitem><para> > - This is the recommended program for collecting profile data, discussed in <xref linkend="controlling-operf" />. > + This is the program for collecting profile data, discussed in <xref linkend="controlling-operf" />. > </para></listitem> > </varlistentry> > > <varlistentry> > - <term><filename>opcontrol</filename></term> > + <term><filename>ocount</filename></term> > <listitem><para> > - Used for controlling OProfile data collection in legacy mode, discussed in <xref linkend="controlling-daemon" />. > + This tool is used for simple event counting, as described in in <xref linkend="controlling-ocount" />. > </para></listitem> > </varlistentry> > > @@ -728,7 +579,7 @@ This section gives a brief description of the available OProfile utilities and t > <term><filename>opimport</filename></term> > <listitem><para> > This utility converts sample database files from a foreign binary format (abi) to > - the native format. This is useful only when moving sample files between hosts, > + the native format. This is useful only when moving sample files between hosts > for analysis on platforms other than the one used for collection. > See <xref linkend="opimport" />. > </para></listitem> > @@ -738,7 +589,7 @@ This section gives a brief description of the available OProfile utilities and t > </sect1> > > </chapter> > - > + > <chapter id="controlling-profiler"> > <title>Controlling the profiler</title> > > @@ -762,7 +613,7 @@ Additionally, each counter is programmed with a "count" value, which corresponds > detailed the profile is. The lower the value, the more frequently profile > samples are taken. You can choose to sample only kernel code, user-space code, > or both (both is the default). Finally, some events have a "unit mask" > --- this is a value that further restricts the types of event that are counted. > +-- this is a value that further restricts the type of event being counted. > You can see the event types and unit masks for your CPU using <command>ophelp</command>. > More information on event specification can be found at <xref linkend="eventspec"/>. > </para> > @@ -783,7 +634,7 @@ Following is a description of the <command>operf</command> options. > <varlistentry> > <term><option>command [args]</option></term> > <listitem><para> > - The command or application to be profiled. The<emphasis>[args]</emphasis> are the input arguments > + The command or application to be profiled. The <emphasis>[args]</emphasis> are the input arguments > that the command or application requires. Either <code>command</code>, <code>--pid</code> or > <code>--system-wide</code> is required, but cannot be used simultaneously. > </para></listitem> > @@ -919,307 +770,7 @@ Following is a description of the <command>operf</command> options. > </variablelist> > </sect1> > > -<sect1 id="controlling-daemon"> > -<title>Using <command>opcontrol</command></title> > -<para> > -In this section we describe the configuration and control of the profiling system > -with opcontrol in more depth. See <xref linkend="controlling-operf"/> for a description > -of the preferred profiling method. > -</para> > -<para> > -The <command>opcontrol</command> script has a default setup, but you > -can alter this with the options given below. In particular, you can select > -specific hardware events on which to base your profile. See <xref linkend="controlling-operf"/> for an > -introduction to hardware events and performance counter configuration. > -The event types and unit masks for your CPU are listed by <command>opcontrol > ---list-events</command> or <command>ophelp</command>. > -</para> > -<para> > -The <command>opcontrol</command> script provides the following actions : > -</para> > -<variablelist> > - <varlistentry> > - <term><option>--init</option></term> > - <listitem><para> > - Loads the OProfile module if required and makes the OProfile driver > - interface available. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--setup</option></term> > - <listitem><para> > - Followed by list arguments for profiling set up. List of arguments > - saved in <filename>/root/.oprofile/daemonrc</filename>. > - Giving this option is not necessary; you can just directly pass one > - of the setup options, e.g. <command>opcontrol --no-vmlinux</command>. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--status</option></term> > - <listitem><para> > - Show configuration information. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--start-daemon</option></term> > - <listitem><para> > - Start the oprofile daemon without starting actual profiling. The profiling > - can then be started using <option>--start</option>. This is useful for avoiding > - measuring the cost of daemon startup, as <option>--start</option> is a simple > - write to a file in oprofilefs. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--start</option></term> > - <listitem><para> > - Start data collection with either arguments provided by <option>--setup</option> > - or information saved in <filename>/root/.oprofile/daemonrc</filename>. Specifying > - the addition <option>--verbose</option> makes the daemon generate lots of debug data > - whilst it is running. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--dump</option></term> > - <listitem><para> > - Force a flush of the collected profiling data to the daemon. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--stop</option></term> > - <listitem><para> > - Stop data collection. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--shutdown</option></term> > - <listitem><para> > - Stop data collection and kill the daemon. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--reset</option></term> > - <listitem><para> > - Clears out data from current session, but leaves saved sessions. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--save=</option>session_name</term> > - <listitem><para> > - Save data from current session to session_name. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--deinit</option></term> > - <listitem><para> > - Shuts down daemon. Unload the OProfile module and oprofilefs. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--list-events</option></term> > - <listitem><para> > - List event types and unit masks. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--help</option></term> > - <listitem><para> > - Generate usage messages. > - </para></listitem> > - </varlistentry> > -</variablelist> > > -<para> > -There are a number of possible settings, of which, only > -<option>--vmlinux</option> (or <option>--no-vmlinux</option>) > -is required. These settings are stored in <filename>~/.oprofile/daemonrc</filename>. > -</para> > -<variablelist> > - <varlistentry> > - <term><option>--buffer-size=</option>num</term> > - <listitem><para> > - Number of samples in kernel buffer. > - Buffer watershed needs to be tweaked when changing this value. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--buffer-watershed=</option>num</term> > - <listitem><para> > - Set kernel buffer watershed to num samples. When remain only > - buffer-size - buffer-watershed free entries remain in the kernel buffer, data will be > - flushed to the daemon. Most useful values are in the range [0.25 - 0.5] * buffer-size. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--cpu-buffer-size=</option>num</term> > - <listitem><para> > - Number of samples in kernel per-cpu buffer. If you > - profile at high rate, it can help to increase this if the log > - file show excessive count of samples lost due to cpu buffer overflow. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--event=</option>[eventspec]</term> > - <listitem><para> > - Use the given performance counter event to profile. > - See <xref linkend="eventspec" /> below. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--session-dir=</option>dir_path</term> > - <listitem><para> > - Create/use sample database out of directory <filename>dir_path</filename> instead of > - the default location (/var/lib/oprofile). > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--separate=</option>[none,lib,kernel,thread,cpu,all]</term> > - <listitem><para> > - By default, every profile is stored in a single file. Thus, for example, > - samples in the C library are all accredited to the <filename>/lib/libc.o</filename> > - profile. However, you choose to create separate sample files by specifying > - one of the below options. > - </para> > - <informaltable frame="all"> > - <tgroup cols='2'> > - <tbody> > - <row><entry><option>none</option></entry><entry>No profile separation (default)</entry></row> > - <row><entry><option>lib</option></entry><entry>Create per-application profiles for libraries</entry></row> > - <row><entry><option>kernel</option></entry><entry>Create per-application profiles for the kernel and kernel modules</entry></row> > - <row><entry><option>thread</option></entry><entry>Create profiles for each thread and each task</entry></row> > - <row><entry><option>cpu</option></entry><entry>Create profiles for each CPU</entry></row> > - <row><entry><option>all</option></entry><entry>All of the above options</entry></row> > - </tbody> > - </tgroup> > - </informaltable> > - <para> > - Note that <option>--separate=kernel</option> also turns on <option>--separate=lib</option>. > - <!-- FIXME: update if this change --> > - When using <option>--separate=kernel</option>, samples in hardware interrupts, soft-irqs, or other > - asynchronous kernel contexts are credited to the task currently running. This means you will see > - seemingly nonsense profiles such as <filename>/bin/bash</filename> showing samples for the PPP modules, > - etc. > - </para> > - <para> > - Using <option>--separate=thread</option> creates a lot > - of sample files if you leave OProfile running for a while; it's most > - useful when used for short sessions, or when using image filtering. > - </para> > - </listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--callgraph=</option>#depth</term> > - <listitem><para> > - Enable call-graph sample collection with a maximum depth. Use 0 to disable > - callgraph profiling. NOTE: Callgraph support is available on a limited > - number of platforms at this time; for example: > - <para> > - <itemizedlist> > - <listitem><para>x86 with 2.6 or higher kernel</para></listitem> > - <listitem><para>ARM with 2.6 or higher kernel</para></listitem> > - <listitem><para>PowerPC with 2.6.17 or higher kernel</para></listitem> > - </itemizedlist> > - </para> > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--image=</option>image,[images]|"all"</term> > - <listitem><para> > - Image filtering. If you specify one or more absolute > - paths to binaries, OProfile will only produce profile results for those > - binary images. This is useful for restricting the sometimes voluminous > - output you may get otherwise, especially with > - <option>--separate=thread</option>. Note that if you are using > - <option>--separate=lib</option> or > - <option>--separate=kernel</option>, then if you specification an > - application binary, the shared libraries and kernel code > - <emphasis>are</emphasis> included. Specify the value > - "all" to profile everything (the default). > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--vmlinux=</option>file</term> > - <listitem><para> > - vmlinux kernel image. > - </para></listitem> > - </varlistentry> > - <varlistentry> > - <term><option>--no-vmlinux</option></term> > - <listitem><para> > - Use this when you don't have a kernel vmlinux file, and you don't want > - to profile the kernel. This still counts the total number of kernel samples, > - but can't give symbol-based results for the kernel or any modules. > - </para></listitem> > - </varlistentry> > -</variablelist> > - > -<sect2 id="opcontrolexamples"> > -<title>Examples</title> > - > -<sect3 id="examplesperfctr"> > -<title>Intel performance counter setup</title> > -<para> > -Here, we have a Pentium III running at 800MHz, and we want to look at where data memory > -references are happening most, and also get results for CPU time. > -</para> > -<screen> > -# opcontrol --event=CPU_CLK_UNHALTED:400000 --event=DATA_MEM_REFS:10000 > -# opcontrol --vmlinux=/boot/2.6.0/vmlinux > -# opcontrol --start > -</screen> > -</sect3> > - > -<sect3 id="examplesstartdaemon"> > -<title>Starting the daemon separately</title> > -<para> > -Use <option>--start-daemon</option> to avoid > -the profiler startup affecting results. > -</para> > -<screen> > -# opcontrol --vmlinux=/boot/2.6.0/vmlinux > -# opcontrol --start-daemon > -# my_favourite_benchmark --init > -# opcontrol --start ; my_favourite_benchmark --run ; opcontrol --stop > -</screen> > -</sect3> > - > -<sect3 id="exampleseparate"> > -<title>Separate profiles for libraries and the kernel</title> > -<para> > -Here, we want to see a profile of the OProfile daemon itself, including when > -it was running inside the kernel driver, and its use of shared libraries. > -</para> > -<screen> > -# opcontrol --separate=kernel --vmlinux=/boot/2.6.0/vmlinux > -# opcontrol --start > -# my_favourite_stress_test --run > -# opreport -l -p /lib/modules/2.6.0/kernel /usr/local/bin/oprofiled > -</screen> > -</sect3> > - > -<sect3 id="examplessessions"> > -<title>Profiling sessions</title> > -<para> > -It can often be useful to split up profiling data into several different > -time periods. For example, you may want to collect data on an application's > -startup separately from the normal runtime data. You can use the simple > -command <command>opcontrol --save</command> to do this. For example : > -</para> > -<screen> > -# opcontrol --save=blah > -</screen> > -<para> > -will create a sub-directory in <filename>$SESSION_DIR/samples</filename> containing the samples > -up to that point (the current session's sample files are moved into this > -directory). You can then pass this session name as a parameter to the post-profiling > -analysis tools, to only get data up to the point you named the > -session. If you do not want to save a session, you can do > -<command>rm -rf $SESSION_DIR/samples/sessionname</command> or, for the > -current session, <command>opcontrol --reset</command>. > -</para> > -</sect3> > -</sect2> > -</sect1> > - > <sect1 id="setup-jit"> > <title>Setting up the JIT profiling feature</title> > <para> > @@ -1265,33 +816,6 @@ current session, <command>opcontrol --reset</command>. > </sect2> > </sect1> > > -<sect1 id="oprofile-gui"> > -<title>Using <command>oprof_start</command></title> > -<para> > -The <command>oprof_start</command> application provides a convenient way to start the profiler. > -Note that <command>oprof_start</command> is just a wrapper around the <command>opcontrol</command> script, > -so it does not provide more services than the script itself. > -</para> > -<para> > -After <command>oprof_start</command> is started you can select the event type for each counter; > -the sampling rate and other related parameters are explained in <xref linkend="controlling-daemon" />. > -The "Configuration" section allows you to set general parameters such as the buffer size, kernel filename > -etc. The counter setup interface should be self-explanatory; <xref linkend="hardware-counters" /> and related > -links contain information on using unit masks. > -</para> > -<para> > -A status line shows the current status of the profiler: how long it has been running, and the average > -number of interrupts received per second and the total, over all processors. > -Note that quitting <command>oprof_start</command> does not stop the profiler. > -</para> > -<para> > -Your configuration is saved in the same file as <command>opcontrol</command> uses; that is, > -<filename>~/.oprofile/daemonrc</filename>. > -</para> > -<para> > -<note><command>oprof_start</command> does not currently support <command>operf</command>.</note> > -</para> > -</sect1> > > <sect1 id="detailed-parameters"> > <title>Configuration details</title> > @@ -1306,7 +830,8 @@ events other than the default event chosen by OProfile. > <note> > <para> > Your CPU type may not include the requisite support for hardware performance counters, in which case > -you must use OProfile in timer mode (see <xref linkend="timer" />). > +you must use OProfile in timer mode (see <xref linkend="timer" />), which is only available in > +OProfile releases prior to 1.0. > </para> > </note> > <para> > @@ -1321,69 +846,73 @@ https://www.power.org/events/Power7</ulink> contains specific information on the > monitor unit for the IBM POWER7. > </para> > <para> > -These processors are capable of delivering an interrupt when a counter overflows. > +A physical performance monitor counter (PMC) is configured by a profiling tool to count a particular > +type of event. When the counter overflows, an interrupt is delivered to the processor. > This is the basic mechanism on which OProfile is based. The delivery mode is <acronym>NMI</acronym>, > so blocking interrupts in the kernel does not prevent profiling. When the interrupt handler is called, > -the current <acronym>PC</acronym> value and the current task are recorded into the profiling structure. > -This allows the overflow event to be attached to a specific assembly instruction in a binary image. > -OProfile receives this data from the kernel and writes it to the sample files. > +the current <acronym>PC</acronym> (program counter) value and the current task are recorded into the profiling structure. > +This allows the overflow event to be attributed to a specific assembly instruction in a specific binary image. > +OProfile receives this data (commonly referred to as a "sample") from the kernel and writes it to the sample files. > </para> > <para> > If we use an event such as <constant>CPU_CLK_UNHALTED</constant> or <constant>INST_RETIRED</constant> > (<constant>GLOBAL_POWER_EVENTS</constant> or <constant>INSTR_RETIRED</constant>, respectively, on the Pentium 4), we can > -use the overflow counts as an estimate of actual time spent in each part of code. Alternatively we can profile interesting > +use the overflow counts (samples) as an estimate of actual time spent in each part of code. Alternatively we can profile interesting > data such as the cache behaviour of routines with the other available counters. > </para> > <para> > However there are several caveats. First, there are those issues listed in the Intel manual. There is a delay > between the counter overflow and the interrupt delivery that can skew results on a small scale - this means > you cannot rely on the profiles at the instruction level as being perfectly accurate. > -If you are using an "event-mode" counter such as the cache counters, a count registered against it doesn't mean > -that it is responsible for that event. However, it implies that the counter overflowed in the dynamic > -vicinity of that instruction, to within a few instructions. Further details on this problem can be found in > +For example, if you are profiling an application with an event that counts L1 cache misses, a sample attributed > +to a particular instruction in the application doesn't necessarily mean that exact instruction is responsible > +for that event; instead, it means the sample was taken in the dynamic vicinity of that instruction, > +usually with a margin of error of a few instructions. Further details on this problem can be found in > <xref linkend="interpreting" /> and also in the Digital paper "ProfileMe: A Hardware Performance Counter". > </para> > <para> > -Each counter has several configuration parameters. > -First, there is the unit mask: this simply further specifies what to count. > -Second, there is the counter value, discussed below. Third, there is a parameter whether to increment counts > +Each counter has several configuration parameters besides the type of event to count. > +First, there is the unit mask, which is used to further qualify exactly what to count. > +Second, there is the <constant>count</constant> field, discussed below. Third, there are parameters > +to specify whether to increment counts > whilst in kernel or user space. You can configure these separately for each counter. > </para> > <para> > -After each overflow event, the counter will be re-initialized > -such that another overflow will occur after this many events have been counted. Thus, higher > -values mean less-detailed profiling, and lower values mean more detail, but higher overhead. > -Picking a good value for this > -parameter is, unfortunately, somewhat of a black art. It is of course dependent on the event > -you have chosen. > +When the profiler is initially setup, a performance monitor counter is chosen for counting the > +event, and it is initialized using the <constant>count</constant> value. > +Once profiling begins, the counter increments with each event detected, and the counter > +<emphasis>overflows</emphasis> when the <constant>count</constant> value is reached. > +As described above, the counter overflow generates an interrupt, and the sample is recorded. > +After each overflow event, the counter is re-initialized using the <constant>count</constant> value, > +and counting begins anew for the next sample. Higher values for <constant>count</constant> > +result in samples being taken less frequently, and therefore less-detailed (and, potentially, > +less accurate) profiling. Lower values mean more detail, but higher overhead. > +Picking a good value for this parameter is, unfortunately, somewhat of a black art. It is > +of course dependent on the event you have chosen. > Specifying too large a value will mean not enough interrupts are generated > -to give a realistic profile (though this problem can be ameliorated by profiling for <emphasis>longer</emphasis>). > -Specifying too small a value can lead to higher performance overhead. > +to give a realistic profile (though this problem can be ameliorated by profiling for > +longer time periods. Specifying too small a value can lead to higher performance overhead. > </para> > > </sect2> > > <sect2 id="timer"> > -<title>OProfile in timer interrupt mode</title> > -<para> > -Some CPU types do not provide the needed hardware support to use the hardware performance counters. This includes > -some laptops, classic Pentiums, and other CPU types not yet supported by OProfile (such as Cyrix). > -On these machines, OProfile falls back to using the timer interrupt for profiling, > -back to using the real-time clock interrupt to collect samples. In timer mode, OProfile > -is not able to profile code that has interrupts disabled. > -</para> > +<title>OProfile timer interrupt mode</title> > <para> > -You can force use of the timer interrupt by using the <option>timer=1</option> module > -parameter (or <option>oprofile.timer=1</option> on the boot command line if OProfile is > -built-in). If OProfile was built as a kernel module, then you must pass the 'timer=1' > -parameter with the modprobe command. Do this before executing 'opcontrol --init' or > -edit the opcontrol command's invocation of modprobe to pass the 'timer=1' parameter. > - > -<note>Timer mode is only available using the legacy <command>opcontrol</command> command.</note> > +Some CPU types do not provide the needed hardware support for hardware performance counters. > +Additionally, some older architectures are not supported by the perf_events kernel subsystem. > +On such machines, the <command>operf</command> and <command>ocount</command> commands will exit with a message indicating the > +processor type is not supported. However, you can install OProfile 0.9.9 and use the legacy > +opcontrol-based profiler, which will fall back to using timer interrupts for profiling. > +Note that in timer mode, OProfile is not able to profile code that has interrupts disabled. > +<note>Timer mode is only available using the legacy <command>opcontrol</command> command, > +available in releases prior to 1.0.</note> > </para> > </sect2> > > -<sect2 id="p4"> > +<sect2 id="special-notes"> > +<title>Architecture-specific configuration notes</title> > +<sect3 id="p4"> > <title>Pentium 4 support</title> > <para> > The Pentium 4 / Xeon performance counters are organized around 3 types of model specific registers (MSRs): 45 event > @@ -1399,338 +928,46 @@ There is currently no support for Precision Event-Based Sampling (PEBS), nor any > (DS). Current support is limited to the conservative extension of OProfile's existing interrupt-based model described > above. > </para> > -</sect2> > - > -<sect2 id="ia64"> > -<title>Intel Itanium 2 support</title> > -<para> > -The Itanium 2 performance monitoring unit (PMU) organizes the counters as four > -pairs of performance event monitoring registers. Each pair is composed of a > -Performance Monitoring Configuration (PMC) register and Performance Monitoring > -Data (PMD) register. The PMC selects the performance event being monitored and > -the PMD determines the sampling interval. The IA64 Performance Monitoring Unit > -(PMU) triggers sampling with maskable interrupts. Thus, samples will not occur > -in sections of the IA64 kernel where interrupts are disabled. > -</para> > -<para> > -None of the advance features of the Itanium 2 performance monitoring unit > -such as opcode matching, address range matching, or precise event sampling are > -supported by this version of OProfile. The Itanium 2 support only maps OProfile's > -existing interrupt-based model to the PMU hardware. > -</para> > -</sect2> > +</sect3> > > -<sect2 id="ppc64"> > +<sect3 id="ppc64"> > <title>PowerPC64 support</title> > <para> > The performance monitoring unit (PMU) for the IBM PowerPC 64-bit processors > -consists of between 4 and 8 counters (depending on the model), plus three > -special purpose registers used for programming the counters -- MMCR0, MMCR1, > -and MMCRA. Advanced features such as instruction matching and thresholding are > -not supported by this version of OProfile. > -<note>Later versions of the IBM POWER5+ processor (beginning with revision 3.0) > -run the performance monitor unit in POWER6 mode, effectively removing OProfile's > -access to counters 5 and 6. These two counters are dedicated to counting > -instructions completed and cycles, respectively. In POWER6 mode, however, the > -counters do not generate an interrupt on overflow and so are unusable by > -OProfile. Kernel versions 2.6.23 and higher will recognize this mode > -and export "ppc64/power5++" as the cpu_type to the oprofilefs pseudo filesystem. > -OProfile userspace responds to this cpu_type by removing these counters from > -the list of potential events to count. Without this kernel support, attempts > -to profile using an event from one of these counters will yield incorrect > -results -- typically, zero (or near zero) samples in the generated report. > -</note> > -</para> > - > -</sect2> > - > -<sect2 id="cell-be"> > -<title>Cell Broadband Engine support</title> > -<para> > -The Cell Broadband Engine (CBE) processor core consists of a PowerPC Processing > -Element (PPE) and 8 Synergistic Processing Elements (SPE). PPEs and SPEs each > -consist of a processing unit (PPU and SPU, respectively) and other hardware > -components, such as memory controllers. > -</para> > -<para> > -A PPU has two hardware threads (aka "virtual CPUs"). The performance monitor > -unit of the CBE collects event information on one hardware thread at a time. > -Therefore, when profiling PPE events, > -OProfile collects the profile based on the selected events by time slicing the > -performance counter hardware between the two threads. The user must ensure the > -collection interval is long enough so that the time spent collecting data for > -each PPU is sufficient to obtain a good profile. > -</para> > -<para> > -To profile an SPU application, the user should specify the SPU_CYCLES event. > -When starting OProfile with SPU_CYCLES, the opcontrol script enforces certain > -separation parameters (separate=cpu,lib) to ensure that sufficient information > -is collected in the sample data in order to generate a complete report. The > ---merge=cpu option can be used to obtain a more readable report if analyzing > -the performance of each separate SPU is not necessary. > -</para> > -<para> > -Profiling with an SPU event (events 4100 through 4163) is not compatible with any other > -event. Further more, only one SPU event can be specified at a time. The hardware only > -supports profiling on one SPU per node at a time. The OProfile kernel code time slices > -between the eight SPUs to collect data on all SPUs. > -</para> > -<para> > -SPU profile reports have some unique characteristics compared to reports for > -standard architectures: > -</para> > -<itemizedlist> > -<listitem>Typically no "app name" column. This is really standard OProfile behavior > -when the report contains samples for just a single application, which is > -commonly the case when profiling SPUs.</listitem> > -<listitem>"CPU" equates to "SPU"</listitem> > -<listitem>Specifying '--long-filenames' on the opreport command does not always result > -in long filenames. This happens when the SPU application code is embedded in > -the PPE executable or shared library. The embedded SPU ELF data contains only the > -short filename (i.e., no path information) for the SPU binary file that was used as > -the source for embedding. The reason that just the short filename is used is because > -the original SPU binary file may not exist or be accessible at runtime. The performance > -analyst must have sufficient knowledge of the application to be able to correlate the > -SPU binary image names found in the report to the application's source files. > -<note> > -Compile the application with -g and generate the OProfile report > -with -g to facilitate finding the right source file(s) on which to focus. > -</note> > -</listitem> > -</itemizedlist> > - > -</sect2> > - > -<sect2 id="amd-ibs-support"> > -<title>AMD64 (x86_64) Instruction-Based Sampling (IBS) support</title> > - > -<para> > -Instruction-Based Sampling (IBS) is a new performance measurement technique > -available on AMD Family 10h processors. Traditional performance counter > -sampling is not precise enough to isolate performance issues to individual > -instructions. IBS, however, precisely identifies instructions which are not > -making the best use of the processor pipeline and memory hierarchy. > -For more information, please refer to the "Instruction-Based Sampling: > -A New Performance Analysis Technique for AMD Family 10h Processors" ( > -<ulink url="http://developer.amd.com/assets/AMD_IBS_paper_EN.pdf"> > -http://developer.amd.com/assets/AMD_IBS_paper_EN.pdf</ulink>). > -There are two types of IBS profile types, described in the following sections. > -<note>Profiling on IBS events is only supported with legacy mode profiling > -(i.e., with <command>opcontrol</command>).</note> > -</para> > - > -<sect3 id="ibs-fetch"> > -<title>IBS Fetch</title> > - > -<para> > -IBS fetch sampling is a statistical sampling method which counts completed > -fetch operations. When the number of completed fetch operations reaches the > -maximum fetch count (the sampling period), IBS tags the fetch operation and > -monitors that operation until it either completes or aborts. When a tagged > -fetch completes or aborts, a sampling interrupt is generated and an IBS fetch > -sample is taken. An IBS fetch sample contains a timestamp, the identifier of > -the interrupted process, the virtual fetch address, and several event flags > -and values that describe what happened during the fetch operation. > -</para> > - > -</sect3> > - > -<sect3 id="ibs-op"> > -<title>IBS Op</title> > - > -<para> > -IBS op sampling selects, tags, and monitors macro-ops as issued from AMD64 > -instructions. Two options are available for selecting ops for sampling: > -</para> > - > -<itemizedlist> > -<listitem> > -Cycles-based selection counts CPU clock cycles. The op is tagged and monitored > -when the count reaches a threshold (the sampling period) and a valid op is > -available. > -</listitem> > - > -<listitem> > -Dispatched op-based selection counts dispatched macro-ops. > -When the count reaches a threshold, the next valid op is tagged and monitored. > -</listitem> > -</itemizedlist> > - > -<para> > -In both cases, an IBS sample is generated only if the tagged op retires. > -Thus, IBS op event information does not measure speculative execution activity. > -The execution stages of the pipeline monitor the tagged macro-op. When the > -tagged macro-op retires, a sampling interrupt is generated and an IBS op > -sample is taken. An IBS op sample contains a timestamp, the identifier of > -the interrupted process, the virtual address of the AMD64 instruction from > -which the op was issued, and several event flags and values that describe > -what happened when the macro-op executed. > +consists of between 4 and 8 counters (depending on the model). Advanced features > +such as instruction matching and thresholding are not supported by OProfile. > </para> > > </sect3> > - > -<para> > -Enabling IBS profiling is done simply by specifying IBS performance events > -through the "--event=" options. These events are listed in the > -<function>opcontrol --list-events</function>. > -</para> > - > -<screen> > -opcontrol --event=IBS_FETCH_XXX:<count>:<um>:<kernel>:<user> > -opcontrol --event=IBS_OP_XXX:<count>:<um>:<kernel>:<user> > - > -Note: * All IBS fetch event must have the same event count and unitmask, > - as do those for IBS op. > -</screen> > - > </sect2> > > -<sect2 id="systemz"> > -<title>IBM System z hardware sampling support</title> > -<para> > -IBM System z provides a facility which does instruction sampling as > -part of the CPU. This has great advantages over the timer based > -sampling approach like better sampling resolution with less overhead > -and the possibility to get samples within code sections where > -interrupts are disabled (useful especially for Linux kernel code). > -</para> > -<note>Profiling with the instruction sampling facility is currently only supported > -with legacy mode profiling (i.e., with <command>opcontrol</command>).</note> > -<para> > -A public description of the System z CPU-Measurement Facilities can be > -found here: > -<ulink url="http://www-01.ibm.com/support/docview.wss?uid=isg26fcd1cc32246f4c8852574ce0044734a">The Load-Program-Parameter and CPU-Measurement Facilities</ulink> > -</para> > -<para> > -System z hardware sampling can be used for Linux instances in LPAR > -mode. The hardware sampling support used by OProfile was introduced > -for System z10 in October 2008. > -</para> > -<para> > -To enable hardware sampling for an LPAR you must activate the LPAR > -with authorization for basic sampling control. See the "Support > -Element Operations Guide" for your mainframe system for more > -information. > -</para> > -<para> > -The hardware sampling facility can be enabled and disabled using the > -event interface. A `virtual' counter 0 has been defined that only supports > -a single event, HWSAMPLING. By default the HWSAMPLING event is > -enabled on machines providing the facility. For both events only the > -`count', `kernel' and `user' options are evaluated by the kernel > -module. > -</para> > -<para> > -The `count' value is the sampling rate as it is passed to the CPU > -measurement facility. A sample will be taken by the hardware every > -`count' cycles. Using low values here will quickly fill up the > -sampling buffers and will generate CPU load on the OProfile daemon and > -the kernel module being busy flushing the hardware buffers. This > -might considerably impact the workload to be profiled. > -</para> > -<para> > -The unit mask `um' is required to be zero. > -</para> > -<para> > -The opcontrol tool provides a new option specific to System z > -hardware sampling: > -</para> > - > -<itemizedlist> > -<listitem>--s390hwsampbufsize="num": Number of 2MB areas > -used per CPU for storing sample data. The best > -size for the sample memory depends on the particular system and the > -workload to be measured. Providing the sampler with too little memory > -results in lost samples. Reserving too much system memory for the > -sampler impacts the overall performance and, hence, also the workload > -to be measured.</listitem> > -</itemizedlist> > - > -<para> > -A special counter <filename>/dev/oprofile/timer</filename> is provided > -by the kernel module allowing to switch back to timer mode sampling > -dynamically. The TIMER event is limited to be used only with this > -counter. The TIMER event can be specified using the > -<option>--event=</option> as with every other event. > -</para> > -<screen>opcontrol --event=TIMER:1</screen> > -<para> > -On z10 or later machines the default event is set to TIMER in case the > -hardware sampling facility is not available. > -</para> > -<para> > -Although required, the 'count' parameter of the TIMER event is > -ignored. The value may eventually be used for timer based sampling > -with a configurable sampling frequency, but this is currently not > -supported. > -</para> > - > -</sect2> > > -<sect2 id="misuse"> > -<title>Dangerous counter settings</title> > -<para> > -OProfile is a low-level profiler which allows continuous profiling with a low-overhead cost. > -When using OProfile legacy mode profiling, it may be possible to configure such a low a counter reset value > -(i.e., high sampling rate) that the system can become overloaded with counter interrupts and your > -system's responsiveness may be severely impacted. Whilst some validation is done on the <code>count</code> > -values you pass to <command>opcontrol</command> with your event specification, it is not foolproof. > -</para> > -<note><para> > -This can happen as follows: When the profiler count > -reaches zero, an NMI handler is called which stores the sample values in an internal buffer, then resets the counter > -to its original value. If the reset count you specified is very low, a pending NMI can be sent before the NMI handler has > -completed. Due to the priority of the NMI, the pending interrupt is delivered immediately after > -completion of the previous interrupt handler, and control never returns to other parts of the system. > -If all processors are stuck in this mode, the system will appear to be frozen. > -</para></note> > -<para>If this happens, it will be impossible to bring the system back to a workable state. > -There is no way to provide real security against this happening, other than making sure to use a reasonable value > -for the counter reset. For example, setting <constant>CPU_CLK_UNHALTED</constant> event type with a ridiculously low reset count (e.g. 500) > -is likely to freeze the system. > -</para> > -<para> > -In short : <command>Don't try a foolish sample count value</command>. Unfortunately the definition of a foolish value > -is really dependent on the event type. If ever in doubt, post a message to <address><email>[email protected]</email>.</address> > -</para> > -<note> > -The scenario described above cannot occur if you use <command>operf</command> for profiling instead of > -<command>opcontrol</command>, because the perf_events kernel subsystem automatically detects when performance monitor > -interrupts are arriving at a dangerous level and will throttle back the sampling rate. > -</note> > -</sect2> > > </sect1> > - > + > </chapter> > > <chapter id="results"> > <title>Obtaining profiling results</title> > <para> > -OK, so the profiler has been running, but it's not much use unless we can get some data out. Sometimes, > -OProfile does a little <emphasis>too</emphasis> good a job of keeping overhead low, and no data reaches > -the profiler. This can happen on lightly-loaded machines. If you're using OPorifle legacy mode, you can > -force a dump at any time with : > -</para> > -<para><command>opcontrol --dump</command></para> > -<para>This ensures that any profile data collected by the <command>oprofiled</command> daemon has been flusehd > -to disk. Remember to do a <code>dump</code>, <code>stop</code>, <code>shutdown</code>, or <code>deinit</code> > -before complaining there is no profiling data! > -</para> > -<para> > -Now that we've got some data, it has to be processed. That's the job of <command>opreport</command>, > -<command>opannotate</command>, or <command>opgprof</command>. > +After collecting profile data, the raw data must undergo special processing in order for you to > +perform your analysis. The analysis tools that perform this special processing are > +<command>opreport</command>, <command>opannotate</command>, and <command>opgprof</command>. > +Additionally, the <command>oparchive</command> is used to gather together profile > +data, sampled binary files, etc. for the purpose of off-line analysis. While > +not really an analysis tool, <command>oparchive</command> is put in that category > +for convenience since it takes many of the same options as the other analysis tools. > </para> > > <sect1 id="profile-spec"> > <title>Profile specifications</title> > > <para> > -All of the analysis tools take a <emphasis>profile specification</emphasis>. > -This is a set of definitions that describe which actual profiles should be > +All of the analysis tools take a <emphasis>profile specification</emphasis> > +as an input argument. > +This is a set of definitions that describes the specific profile data that should be > examined. The simplest profile specification is empty: this will match all > -the available profile files for the current session (this is what happens > -when you do <command>opreport</command>). > +the available profile files for the current session. > </para> > <para> > Specification parameters are of the form <option>name:value[,value]</option>. > @@ -1738,10 +975,11 @@ For example, if I wanted to get a combined symbol summary for > <filename>/bin/myprog</filename> and <filename>/bin/myprog2</filename>, > I could do <command>opreport -l image:/bin/myprog,/bin/myprog2</command>. > As a special case, you don't actually need to specify the <option>image:</option> > -part here: anything left on the command line is assumed to be an > +part of the specification. Anything left on the command line after all other > +<command>opreport</command> options have been processed is assumed to be an > <option>image:</option> name. Similarly, if no <option>session:</option> > is specified, then <option>session:current</option> is assumed ("current" > -is a special name of the current / last profiling session). > +is a special name of the current (i.e., most recent) profiling session). > </para> > <para> > In addition to the comma-separated list shown above, some of the > @@ -1848,10 +1086,7 @@ Differential profile of an archived binary with the current session : > <term><option>lib-image:</option><emphasis>imagelist</emphasis></term> > <listitem><para> > Same as <option>image:</option>, but only for images that are for > - a particular primary binary image (namely, an application). This only > - makes sense to use if you're using <option>--separate</option>. > - This includes kernel modules and the kernel when using > - <option>--separate=kernel</option>. > + a particular primary binary image (namely, an application). > </para></listitem> > </varlistentry> > > @@ -1868,7 +1103,6 @@ Differential profile of an archived binary with the current session : > <listitem><para> > The symbolic event name to match on, e.g. <option>event:DATA_MEM_REFS</option>. > You can pass a list of events for side-by-side comparison with <command>opreport</command>. > - When using the timer interrupt, the event is always "TIMER". > </para></listitem> > </varlistentry> > > @@ -1877,11 +1111,10 @@ Differential profile of an archived binary with the current session : > <listitem><para> > The event count to match on, e.g. <option>event:DATA_MEM_REFS count:30000</option>. > Note that this value refers to the count value in the event spec you passed > - to <command>opcontrol</command> or <command>operf</command> when setting up to do a > + to <command>operf</command> when setting up to do a > profile run. It has nothing to do with the sample counts in the profile data > itself. > You can pass a list of events for side-by-side comparison with <command>opreport</command>. > - When using the timer interrupt, the count is always 0 (indicating it cannot be set). > </para></listitem> > </varlistentry> > > @@ -1930,9 +1163,8 @@ Differential profile of an archived binary with the current session : > <sect2 id="locating-and-managing-binary-images"> > <title>Locating and managing binary images</title> > <para> > -Each session's sample files can be found in the $SESSION_DIR/samples/ directory (default when > -using legacy mode: <filename>/var/lib/oprofile/samples/</filename>; default when using > -<command>operf</command>: <filename><cur_dir>/oprofile_data/samples/</filename>). > +Each session's sample files can be found in the $SESSION_DIR/samples/ directory (default > +for <command>operf</command> is <filename><cur_dir>/oprofile_data/samples/</filename>). > These are used, along with the binary image files, to produce human-readable data. > In some circumstances (e.g., kernel modules), OProfile > will not be able to find the binary images. All the tools have an <option>--image-path</option> > @@ -1979,19 +1211,14 @@ taken per second. > <varlistentry><term>application spent most of its time in libraries</term><listitem><para> > Similarly, if the application spends little time in the main binary image > itself, with most of it spent in shared libraries it uses, you might > -not see any samples for the binary image (i.e., executable) itself. If you're > -using OProfile legacy mode profiling, then we recommend using > -<command>opcontrol --separate=lib</command> before the > -profiling session so that <command>opreport</command> and friends show > -the library profiles on a per-application basis. This is done automatically > -when profiling with <command>operf</command>, so no special setup is necessary. > +not see any samples for the binary image (i.e., executable) itself. > </para></listitem></varlistentry> > <varlistentry><term>specification was really too strict</term><listitem><para> > For example, you specified something like <option>tgid:3433</option>, > but no task with that group ID ever ran the code. > </para></listitem></varlistentry> > <varlistentry><term>application didn't generate any events</term><listitem><para> > -If you're using a particular event counter, for example counting MMX > +If you're profiling a particular event, for example counting MMX > operations, the code might simply have not generated any events in the > first place. Verify the code you're profiling does what you expect it > to. > @@ -2015,52 +1242,66 @@ The <command>opreport</command> utility is the primary utility you will use for > getting formatted data out of OProfile. It produces two types of data: image summaries > and symbol summaries. An image summary lists the number of samples for individual > binary images such as libraries or applications. Symbol summaries provide per-symbol > -profile data. In the following example, we're getting an image summary for the whole > +profile data. In the following truncated example, we see an image summary for the whole > system: > </para> > <screen> > $ opreport --long-filenames > -CPU: PIII, speed 863.195 MHz (estimated) > -Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 0x00 (No unit mask) count 23150 > - 905898 59.7415 /usr/lib/gcc-lib/i386-redhat-linux/3.2/cc1plus > - 214320 14.1338 /boot/2.6.0/vmlinux > - 103450 6.8222 /lib/i686/libc-2.3.2.so > - 60160 3.9674 /usr/local/bin/madplay > - 31769 2.0951 /usr/local/oprofile-pp/bin/oprofiled > - 26550 1.7509 /usr/lib/libartsflow.so.1.0.0 > - 23906 1.5765 /usr/bin/as > - 18770 1.2378 /oprofile > - 15528 1.0240 /usr/lib/qt-3.0.5/lib/libqt-mt.so.3.0.5 > - 11979 0.7900 /usr/X11R6/bin/XFree86 > - 11328 0.7471 /bin/bash > +CPU: Intel Sandy Bridge microarchitecture, speed 2401 MHz (estimated) > +Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000 > +CPU_CLK_UNHALT...| > + samples| %| > +------------------ > + 22577 28.9011 /usr/bin/Xorg > + CPU_CLK_UNHALT...| > + samples| %| > + ------------------ > + 16846 74.6158 /proc/kallsyms > + 2126 9.4167 /usr/bin/Xorg > + 763 3.3795 /usr/lib64/libpixman-1.so.0.26.2 > + ... > + 17402 22.2766 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.55.x86_64/jre/bin/java > + CPU_CLK_UNHALT...| > + samples| %| > + ------------------ > + 5666 32.5595 anon (tgid:29664 range:0x7f3475000000-0x7f347616ffff) > + 2312 13.2858 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.55.x86_64/jre/lib/amd64/server/libjvm.so > + ... > + 11554 14.7904 /home/user1/oprof-install/bin/operf > + CPU_CLK_UNHALT...| > + samples| %| > + ------------------ > + 7467 64.6270 /proc/kallsyms > + 1691 14.6356 /usr/bin/operf > + 1324 11.4592 /lib64/libc-2.12.so > + 455 3.9380 /usr/lib64/libstdc++.so.6.0.13 > + 315 2.7263 /ext4 > + ... > ... > </screen> > <para> > If we had specified <option>--symbols</option> in the previous command, we would have > gotten a symbol summary of all the images across the entire system. We can restrict this to only > part of the system profile; for example, > -below is a symbol summary of the OProfile daemon. Note that as we used > -<command>opcontrol --separate=lib,kernel</command>, symbols from images that <command>oprofiled</command> > -has used are also shown. > +below is a symbol summary for the <command>operf</command> program used to collect the profile. > </para> > <screen> > -$ opreport -l -p /lib/modules/`uname -r` `which oprofiled` 2>/dev/null | more > -CPU: Core 2, speed 2.534e+06 MHz (estimated) > -Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000 > +$ opreport -l -p /lib/modules/`uname -r` `which operf` 2>/dev/null | more > +CPU: Intel Sandy Bridge microarchitecture, speed 2401 MHz (estimated) > +Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000 > samples % image name symbol name > -1353 24.9447 vmlinux sidtab_context_to_sid > -500 9.2183 vmlinux avtab_hash_eval > -154 2.8392 vmlinux __link_path_walk > -152 2.8024 vmlinux d_prune_aliases > -120 2.2124 vmlinux avtab_search_node > -104 1.9174 vmlinux find_next_bit > -85 1.5671 vmlinux selinux_file_fcntl > -82 1.5118 vmlinux avtab_write > -81 1.4934 oprofiled odb_update_node_with_offset > -73 1.3459 oprofiled opd_process_samples > -72 1.3274 vmlinux avc_has_perm_noaudit > -61 1.1246 libc-2.12.so _IO_vfscanf > -59 1.0878 ext4.ko ext4_mark_iloc_dirty > +860 7.4607 kallsyms avtab_search_node > +474 4.1121 operf OP_perf_utils::op_write_event(event_union*, unsigned long long) > +461 3.9993 kallsyms avc_has_perm_noaudit > +455 3.9473 libstdc++.so.6.0.13 /usr/lib64/libstdc++.so.6.0.13 > +412 3.5742 libc-2.12.so _IO_vfscanf > +369 3.2012 kallsyms __d_lookup > +350 3.0363 kallsyms sidtab_context_to_sid > +274 2.3770 operf OP_perf_utils::op_record_process_exec_mmaps(int, int, int, operf_record*) > +232 2.0127 operf operf_process_info::find_mapping_for_sample(unsigned long long, bool) > +222 1.9259 kallsyms __link_path_walk > +191 1.6570 kallsyms pipe_read > +34 0.2950 ext4.ko ext4_mark_iloc_dirty > ... > </screen> > > @@ -2076,8 +1317,8 @@ If you have used one of the <option>--separate[*]</option> options > whilst profiling, there can be several separate profiles for > a single binary image within a session. Normally the output > will keep these images separated. So, for example, if you profiled > -with separation on a per-cpu basis (<code>opcontrol --separate=cpu</code> or > -<code>operf --separate-cpu</code>), you would see separate columns in > +with separation on a per-cpu basis (<code>operf --separate-cpu</code>), > +you would see separate columns in > the output of <command>opreport</command> for each CPU where samples > were recorded. But it can be useful to merge these results back together > to make the report more readable. The <option>--merge</option> option allows > @@ -2251,13 +1492,12 @@ A typical way to use this feature is with archives created with > <command>oparchive</command>. Let's look at an example: > </para> > <screen> > -$ ./a > +$ operf ./a > $ oparchive -o orig ./a > -$ opcontrol --reset > # edit and recompile a > -$ ./a > +$ operf ./a > # now compare the current profile of a with the archived profile > -$ opreport -xl ./a { archive:./orig } { } > +$ opreport --session-dir=`pwd`/oprofile_data/ -xl ./a { archive:./orig } { } > CPU: PIII, speed 863.233 MHz (estimated) > Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a > unit mask of 0x00 (No unit mask) count 100000 > @@ -2326,8 +1566,7 @@ samples % image name symbol name > </para> > <para> > Note that, since such mappings are dependent upon individual invocations of > -a binary, these mappings are always listed as a dependent image, > -even when using the legacy mode <option>opcontrol --separate=none</option> command. > +a binary, these mappings are always listed as a dependent image. > Equally, the results are not affected by the <option>--merge</option> > option. > </para> > @@ -2388,8 +1627,7 @@ offsets for the image binary. > </para></listitem></varlistentry> > <varlistentry><term><option>--exclude-dependent / -x</option></term><listitem><para> > Do not include application-specific images for libraries, kernel modules > -and the kernel. This option only makes sense if the profile session > -used --separate. > +and the kernel.. > </para></listitem></varlistentry> > <varlistentry><term><option>--exclude-symbols / -e [symbols]</option></term><listitem><para> > Exclude all the symbols in the given comma-separated list. > @@ -2425,9 +1663,13 @@ Output to the given file instead of stdout. > <varlistentry><term><option>--reverse-sort / -r</option></term><listitem><para> > Reverse the sort from the default. > </para></listitem></varlistentry> > -<varlistentry><term><option>--session-dir=</option>dir_path</term><listitem><para> > -Use sample database out of directory <filename>dir_path</filename> > -instead of the default location (/var/lib/oprofile). > +<varlistentry><term><option>--session-dir=dir_path</option></term><listitem><para> > +Use sample database from the specified directory <filename>dir_path</filename> instead > +of the default location. If this option is not specified, then opreport will search for > +samples in <filename><cur_dir>/oprofile_data</filename> > +first. If that directory does not exist, the standard session-dir of > +<filename>/var/lib/oprofile</filename> is used > +as the session directory. > </para></listitem></varlistentry> > <varlistentry><term><option>--show-address / -w</option></term><listitem><para> > Show the VMA address of each symbol (off by default). > @@ -2571,8 +1813,7 @@ pattern-matching to make C++ symbol demangling more readable. > </para></listitem></varlistentry> > <varlistentry><term><option>--exclude-dependent / -x</option></term><listitem><para> > Do not include application-specific images for libraries, kernel modules > -and the kernel. This option only makes sense if the profile session > -used --separate. > +and the kernel. > </para></listitem></varlistentry> > <varlistentry><term><option>--exclude-file [files]</option></term><listitem><para> > Exclude all files in the given comma-separated list of glob patterns. > @@ -2640,6 +1881,14 @@ source files when the debug information only contains relative paths. > Output annotated source. This requires debugging information to be available > for the binaries. > </para></listitem></varlistentry> > +<varlistentry><term><option>--session-dir=dir_path</option></term><listitem><para> > +Use sample database from the specified directory <filename>dir_path</filename> instead > +of the default location. If this option is not specified, then opannotate will search for > +samples in <filename><cur_dir>/oprofile_data</filename> > +first. If that directory does not exist, the standard session-dir of > +<filename>/var/lib/oprofile</filename> is used > +as the session directory. > +</para></listitem></varlistentry> > <varlistentry><term><option>--threshold / -t [percentage]</option></term><listitem><para> > Only output data for symbols that have more than the given percentage > of total samples. > @@ -2762,6 +2011,14 @@ of total samples. > </para></listitem></varlistentry> > <varlistentry><term><option>--verbose / -V [options]</option></term><listitem><para> > Give verbose debugging output. > +<varlistentry><term><option>--session-dir=dir_path</option></term><listitem><para> > +Use sample database from the specified directory <filename>dir_path</filename> instead > +of the default location. If this option is not specified, then opgprof will search for > +samples in <filename><cur_dir>/oprofile_data</filename> > +first. If that directory does not exist, the standard session-dir of > +<filename>/var/lib/oprofile</filename> is used > +as the session directory. > +</para></listitem></varlistentry> > </para></listitem></varlistentry> > <varlistentry><term><option>--version / -v</option></term><listitem><para> > Show version. > @@ -2854,8 +2111,7 @@ Show help message. > </para></listitem></varlistentry> > <varlistentry><term><option>--exclude-dependent / -x</option></term><listitem><para> > Do not include application-specific images for libraries, kernel modules > -and the kernel. This option only makes sense if the profile session > -used --separate. > +and the kernel. > </para></listitem></varlistentry> > <varlistentry><term><option>--image-path / -p [paths]</option></term><listitem><para> > Comma-separated list of additional paths to search for binaries. > @@ -2873,6 +2129,14 @@ Only list the files that would be archived, don't copy them. > <varlistentry><term><option>--verbose / -V [options]</option></term><listitem><para> > Give verbose debugging output. > </para></listitem></varlistentry> > +<varlistentry><term><option>--session-dir=dir_path</option></term><listitem><para> > +Use sample database from the specified directory <filename>dir_path</filename> instead > +of the default location. If this option is not specified, then oparchive will search for > +samples in <filename><cur_dir>/oprofile_data</filename> > +first. If that directory does not exist, the standard session-dir of > +<filename>/var/lib/oprofile</filename> is used > +as the session directory. > +</para></listitem></varlistentry> > <varlistentry><term><option>--version / -v</option></term><listitem><para> > Show version. > </para></listitem></varlistentry> > @@ -3057,10 +2321,7 @@ problem and OProfile can do nothing about it. > OProfile uses non-maskable interrupts (NMI) on the P6 generation, Pentium 4, > Athlon, Opteron, Phenom, and Turion processors. These interrupts can occur even in sections of the > kernel where interrupts are disabled, allowing collection of samples in virtually > -all executable code. The timer interrupt mode and Itanium 2 collection mechanisms > -use maskable interrupts; therefore, these profiling mechanisms have "sample > -shadows", or blind spots: regions where no samples will be collected. Typically, the samples > -will be attributed to the code immediately after the interrupts are re-enabled. > +all executable code. > </para> > </sect2> > <sect2 id="idle"> > @@ -3080,7 +2341,7 @@ will appear as <function>poll_idle()</function> in your kernel profile. > OProfile profiles kernel modules by default. However, there are a couple of problems > you may have when trying to get results. First, you may have booted via an initrd; > this means that the actual path for the module binaries cannot be determined automatically. > -To get around this, you can use the <option>-p</option> option to the profiling tools > +To get around this, you can use the <option>-p</option> option to the analysis tools > to specify where to look for the kernel modules. > </para> > <para> > @@ -3105,7 +2366,7 @@ information for OProfile to get this information. > <sect1 id="interpreting-callgraph"> > <title>Interpreting call-graph profiles</title> > <para> > -Sometimes the results from call-graph profiles may be different to what > +Sometimes the results from call-graph profiles may be different from what > you expect to see. The first thing to check is whether the target > binaries where compiled with frame pointers enabled (if the binary was > compiled using <command>gcc</command>'s > diff --git a/events/Makefile.am b/events/Makefile.am > index 67be125..14531cd 100644 > --- a/events/Makefile.am > +++ b/events/Makefile.am > @@ -23,9 +23,6 @@ event_files = \ > i386/haswell/events i386/haswell/unit_masks \ > i386/broadwell/events i386/broadwell/unit_masks \ > i386/silvermont/events i386/silvermont/unit_masks \ > - ia64/ia64/events ia64/ia64/unit_masks \ > - ia64/itanium2/events ia64/itanium2/unit_masks \ > - ia64/itanium/events ia64/itanium/unit_masks \ > ppc64/architected_events_v1/events ppc64/architected_events_v1/unit_masks \ > ppc64/power4/events ppc64/power4/event_mappings ppc64/power4/unit_masks \ > ppc64/power5/events ppc64/power5/event_mappings ppc64/power5/unit_masks \ > @@ -36,10 +33,6 @@ event_files = \ > ppc64/power8/events ppc64/power8/unit_masks \ > ppc64/970/events ppc64/970/event_mappings ppc64/970/unit_masks \ > ppc64/970MP/events ppc64/970MP/event_mappings ppc64/970MP/unit_masks \ > - ppc64/ibm-compat-v1/events ppc64/ibm-compat-v1/event_mappings ppc64/ibm-compat-v1/unit_masks \ > - ppc64/pa6t/events ppc64/pa6t/event_mappings ppc64/pa6t/unit_masks \ > - ppc64/cell-be/events ppc64/cell-be/unit_masks \ > - rtc/events rtc/unit_masks \ > x86-64/hammer/events x86-64/hammer/unit_masks \ > x86-64/family10/events x86-64/family10/unit_masks \ > x86-64/family11h/events x86-64/family11h/unit_masks \ > @@ -64,7 +57,6 @@ event_files = \ > arm/armv8-xgene/events arm/armv8-xgene/unit_masks \ > arm/armv8-ca57/events arm/armv8-ca57/unit_masks \ > arm/armv8-ca53/events arm/armv8-ca53/unit_masks \ > - avr32/events avr32/unit_masks \ > mips/20K/events mips/20K/unit_masks \ > mips/24K/events mips/24K/unit_masks \ > mips/25K/events mips/25K/unit_masks \ > diff --git a/events/avr32/events b/events/avr32/events > deleted file mode 100644 > index 489d914..0000000 > --- a/events/avr32/events > +++ /dev/null > @@ -1,27 +0,0 @@ > -# AVR32 events > -# > -event:0x00 counters:1,2 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses > -event:0x01 counters:1,2 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled > -event:0x02 counters:1,2 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall due to data dependency > -event:0x03 counters:1,2 um:zero minimum:500 name:ITLB_MISS : number of Instruction TLB misses > -event:0x04 counters:1,2 um:zero minimum:500 name:DTLB_MISS : number of Data TLB misses > -event:0x05 counters:1,2 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change > -event:0x06 counters:1,2 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted > -event:0x07 counters:1,2 um:zero minimum:500 name:INSN_EXECUTED : instructions executed > -event:0x08 counters:1,2 um:zero minimum:500 name:DCACHE_WBUF_FULL : data cache write buffers full > -event:0x09 counters:1,2 um:zero minimum:500 name:CYCLES_DCACHE_WBUF_FULL : cycles stalled due to data cache write buffers full > -event:0x0a counters:1,2 um:zero minimum:500 name:DCACHE_READ_MISS : data cache read miss > -event:0x0b counters:1,2 um:zero minimum:500 name:CYCLES_DCACHE_READ_MISS : cycles stalled due to data cache read miss > -event:0x0c counters:1,2 um:zero minimum:500 name:WRITE_ACCESS : write access > -event:0x0d counters:1,2 um:zero minimum:500 name:CYCLES_WRITE_ACCESS : cycles when write access is ongoing > -event:0x0e counters:1,2 um:zero minimum:500 name:READ_ACCESS : read access > -event:0x0f counters:1,2 um:zero minimum:500 name:CYCLES_READ_ACCESS : cycles when read access is ongoing > -event:0x10 counters:1,2 um:zero minimum:500 name:CACHE_STALL : read or write access that stalled > -event:0x11 counters:1,2 um:zero minimum:500 name:CYCLES_CACHE_STALL : cycles stalled doing read or write access > -event:0x12 counters:1,2 um:zero minimum:500 name:DCACHE_ACCESS : data cache access > -event:0x13 counters:1,2 um:zero minimum:500 name:CYCLES_DCACHE_ACCESS : cycles when data cache access is ongoing > -event:0x14 counters:1,2 um:zero minimum:500 name:DCACHE_WB : data cache line writeback > -event:0x15 counters:1,2 um:zero minimum:500 name:ACCUMULATOR_HIT : accumulator cache hit > -event:0x16 counters:1,2 um:zero minimum:500 name:ACCUMULATOR_MISS : accumulator cache miss > -event:0x17 counters:1,2 um:zero minimum:500 name:BTB_HIT : branch target buffer hit > -event:0xff counters:0 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter > diff --git a/events/avr32/unit_masks b/events/avr32/unit_masks > deleted file mode 100644 > index 37d9839..0000000 > --- a/events/avr32/unit_masks > +++ /dev/null > @@ -1,4 +0,0 @@ > -# AVR32 performance counters possible unit masks > -# > -name:zero type:mandatory default:0x00 > - 0x00 No unit mask > diff --git a/events/ia64/ia64/events b/events/ia64/ia64/events > deleted file mode 100644 > index 8ae41dd..0000000 > --- a/events/ia64/ia64/events > +++ /dev/null > @@ -1,3 +0,0 @@ > -# IA-64 events > -event:0x12 counters:0,1,2,3 um:zero minimum:500 name:CPU_CYCLES : CPU Cycles > -event:0x08 counters:0,1,2,3 um:zero minimum:500 name:IA64_INST_RETIRED : IA-64 Instructions Retired > diff --git a/events/ia64/ia64/unit_masks b/events/ia64/ia64/unit_masks > deleted file mode 100644 > index 7dd854a..0000000 > --- a/events/ia64/ia64/unit_masks > +++ /dev/null > @@ -1,4 +0,0 @@ > -# IA-64 possible unit masks > -# > -name:zero type:mandatory default:0x0 > - 0x0 No unit mask > diff --git a/events/ia64/itanium/events b/events/ia64/itanium/events > deleted file mode 100644 > index b0ce10f..0000000 > --- a/events/ia64/itanium/events > +++ /dev/null > @@ -1,5 +0,0 @@ > -# IA-64 Itanium 1 events > -event:0x12 counters:0,1,2,3 um:zero minimum:500 name:CPU_CYCLES : CPU Cycles > -event:0x08 counters:0,1 um:zero minimum:500 name:IA64_INST_RETIRED : IA-64 Instructions Retired > -event:0x15 counters:0,1,2,3 um:zero minimum:500 name:IA32_INST_RETIRED : IA-32 Instructions Retired > -# FIXME: itanium doc describe a lot of other events, should we add them w/o any testing ? > diff --git a/events/ia64/itanium/unit_masks b/events/ia64/itanium/unit_masks > deleted file mode 100644 > index 6a9f77b..0000000 > --- a/events/ia64/itanium/unit_masks > +++ /dev/null > @@ -1,4 +0,0 @@ > -# IA-64 Itanium 1 possible unit masks > -# > -name:zero type:mandatory default:0x0 > - 0x0 No unit mask > diff --git a/events/ia64/itanium2/events b/events/ia64/itanium2/events > deleted file mode 100644 > index c979022..0000000 > --- a/events/ia64/itanium2/events > +++ /dev/null > @@ -1,267 +0,0 @@ > -# IA-64 Itanium 2 events > - > -# IA64_2 Basic Events, Table 11-1 > -event:0x12 counters:0,1,2,3 um:zero minimum:500 name:CPU_CYCLES : CPU Cycles > -event:0x08 counters:0,1,2,3 um:zero minimum:500 name:IA64_INST_RETIRED : IA-64 Instructions Retired > -event:0x59 counters:0,1,2,3 um:zero minimum:5000 name:IA32_INST_RETIRED : IA-32 Instructions Retired > -event:0x07 counters:0,1,2,3 um:zero minimum:500 name:IA32_ISA_TRANSITIONS : Itanium to/from IA-32 ISA Transitions > - > -# IA64_2 Instruction Disperal Events, Table 11-3 > -event:0x49 counters:0,1,2,3 um:zero minimum:5000 name:DISP_STALLED : Number of cycles dispersal stalled > -event:0x4d counters:0,1,2,3 um:zero minimum:5000 name:INST_DISPERSED : Syllables Dispersed from REN to REG stage > -event:0x4e counters:0,1,2,3 um:syll_not_dispersed minimum:5000 name:SYLL_NOT_DISPERSED : Syllables not dispersed > -event:0x4f counters:0,1,2,3 um:syll_overcount minimum:5000 name:SYLL_OVERCOUNT : Syllables overcounted > - > -# IA64_2 Instruction Execution Events, Table 11-4 > -event:0x58 counters:0,1,2,3 um:alat_capacity_miss minimum:5000 name:ALAT_CAPACITY_MISS : ALAT Entry Replaced > -event:0x06 counters:0,1,2,3 um:zero minimum:5000 name:FP_FAILED_FCHKF : Failed fchkf > -event:0x05 counters:0,1,2,3 um:zero minimum:5000 name:FP_FALSE_SIRSTALL : SIR stall without a trap > -event:0x0b counters:0,1,2,3 um:zero minimum:5000 name:FP_FLUSH_TO_ZERO : Result Flushed to Zero > -event:0x09 counters:0,1,2,3 um:zero minimum:5000 name:FP_OPS_RETIRED : Retired FP operations > -event:0x03 counters:0,1,2,3 um:zero minimum:5000 name:FP_TRUE_SIRSTALL : SIR stall asserted and leads to a trap > -event:0x08 counters:0,1,2,3 um:tagged_inst_retired minimum:5000 name:IA64_TAGGED_INST_RETIRED : Retired Tagged Instructions > -event:0x56 counters:0,1,2,3 um:alat_capacity_miss minimum:5000 name:INST_CHKA_LDC_ALAT : Advanced Check Loads > -event:0x57 counters:0,1,2,3 um:alat_capacity_miss minimum:5000 name:INST_FAILED_CHKA_LDC_ALAT : Failed Advanced Check Loads > -event:0x55 counters:0,1,2,3 um:alat_capacity_miss minimum:5000 name:INST_FAILED_CHKS_RETIRED : Failed Speculative Check Loads > -# To avoid duplication from other tables the following events commented out > -#event:0xcd counters:0,1,2,3 um:zero minimum:5000 name:LOADS_RETIRED : Retired Loads > -#event:0xce counters:0,1,2,3 um:zero minimum:5000 name:MISALIGNED_LOADS_RETIRED : Retired Misaligned Load Instructions > -#event:0xcf counters:0,1,2,3 um:zero minimum:5000 name:UC_LOADS_RETIRED : Retired Uncacheable Loads > -#event:0xd1 counters:0,1,2,3 um:zero minimum:5000 name:STORES_RETIRED : Retired Stores > -#event:0xd2 counters:0,1,2,3 um:zero minimum:5000 name:MISALIGNED_STORES_RETIRED : Retired Misaligned Store Instructions > -#event:0xd0 counters:0,1,2,3 um:zero minimum:5000 name:UC_STORES_RETIRED : Retired Uncacheable Stores > -event:0x50 counters:0,1,2,3 um:zero minimum:5000 name:NOPS_RETIRED : Retired NOP Instructions > -event:0x51 counters:0,1,2,3 um:zero minimum:5000 name:PREDICATE_SQUASHED_RETIRED : Instructions Squashed Due to Predicate Off` > - > -# IA64_2 Stall Events, Table 11-6 > -event:0x00 counters:0,1,2,3 um:back_end_bubble minimum:5000 name:BACK_END_BUBBLE : Full pipe bubbles in main pipe > -event:0x02 counters:0,1,2,3 um:be_exe_bubble minimum:5000 name:BE_EXE_BUBBLE : Full pipe bubbles in main pipe due to Execution unit stalls > -event:0x04 counters:0,1,2,3 um:be_flush_bubble minimum:5000 name:BE_FLUSH_BUBBLE : Full pipe bubbles in main pipe due to flushes > -event:0xca counters:0,1,2,3 um:be_l1d_fpu_bubble minimum:5000 name:BE_L1D_FPU_BUBBLE : Full pipe bubbles in main pipe due to FP or L1 dcache > -# To avoid duplication from other tables the following events commented out > -#event:0x72 counters:0,1,2,3 um:be_lost_bw_due_to_fe minimum:5000 name:BE_LOST_BW_DUE_TO_FE : Invalid bundles if BE not stalled for other reasons > -event:0x01 counters:0,1,2,3 um:be_rse_bubble minimum:5000 name:BE_RSE_BUBBLE : Full pipe bubbles in main pipe due to RSE stalls > -event:0x71 counters:0,1,2,3 um:fe_bubble minimum:5000 name:FE_BUBBLE : Bubbles seen by FE > -event:0x70 counters:0,1,2,3 um:fe_lost minimum:5000 name:FE_LOST_BW : Invalid bundles at the entrance to IB > -event:0x73 counters:0,1,2,3 um:fe_lost minimum:5000 name:IDEAL_BE_LOST_BW_DUE_TO_FE : Invalid bundles at the exit from IB > - > -# IA64_2 Branch Events, Table 11-7 > -event:0x61 counters:0,1,2,3 um:be_br_mispredict_detail minimum:5000 name:BE_BR_MISPRED_DETAIL : BE branch misprediction detail > -event:0x11 counters:0,1,2,3 um:zero minimum:5000 name:BRANCH_EVENT : Branch Event Captured > -event:0x5b counters:0,1,2,3 um:br_mispred_detail minimum:5000 name:BR_MISPRED_DETAIL : Branch Mispredict Detail > -event:0x68 counters:0,1,2,3 um:br_mispredict_detail2 minimum:5000 name:BR_MISPRED_DETAIL2 : FE Branch Mispredict Detail (Unknown path component) > -event:0x54 counters:0,1,2,3 um:br_path_pred minimum:5000 name:BR_PATH_PRED : FE Branch Path Prediction Detail > -event:0x6a counters:0,1,2,3 um:br_path_pred2 minimum:5000 name:BR_PATH_PRED2 : FE Branch Path Prediction Detail (Unknown prediction component) > -event:0x63 counters:0,1,2,3 um:encbr_mispred_detail minimum:5000 name:ENCBR_MISPRED_DETAIL : Number of encoded branches retired > - > -# IA64_2 L1 Instruction Cache and Prefetch Events, Table 11-8 > -event:0x46 counters:0,1,2,3 um:zero minimum:5000 name:ISB_BUNPAIRS_IN : Bundle pairs written from L2 into FE > -event:0x43 counters:0,1,2,3 um:zero minimum:5000 name:L1I_EAR_EVENTS : Instruction EAR Events > -event:0x66 counters:0,1,2,3 um:zero minimum:5000 name:L1I_FETCH_ISB_HIT : "\"Just-in-time\" instruction fetch hitting in and being bypassed from ISB > -event:0x65 counters:0,1,2,3 um:zero minimum:5000 name:L1I_FETCH_RAB_HIT : Instruction fetch hitting in RAB > -event:0x41 counters:0,1,2,3 um:zero minimum:5000 name:L1I_FILLS : L1 Instruction Cache Fills > -event:0x44 counters:0,1,2,3 um:zero minimum:5000 name:L1I_PREFETCHES : Instruction Prefetch Requests > -event:0x42 counters:0,1,2,3 um:zero minimum:5000 name:L2_INST_DEMAND_READS : L1 Instruction Cache and ISB Misses > -event:0x67 counters:0,1,2,3 um:l1i_prefetch_stall minimum:5000 name:L1I_PREFETCH_STALL : Why prefetch pipeline is stalled? > -event:0x4b counters:0,1,2,3 um:zero minimum:5000 name:L1I_PURGE : L1ITLB purges handled by L1I > -event:0x69 counters:0,1,2,3 um:zero minimum:5000 name:L1I_PVAB_OVERFLOW : PVAB overflow > -event:0x64 counters:0,1,2,3 um:zero minimum:5000 name:L1I_RAB_ALMOST_FULL : Is RAB almost full? > -event:0x60 counters:0,1,2,3 um:zero minimum:500 name:L1I_RAB_FULL : Is RAB full? > -event:0x40 counters:0,1,2,3 um:zero minimum:5000 name:L1I_READS : L1 Instruction Cache Read > -event:0x4a counters:0,1,2,3 um:zero minimum:5000 name:L1I_SNOOP : Snoop requests handled by L1I > -event:0x5f counters:0,1,2,3 um:zero minimum:5000 name:L1I_STRM_PREFETCHES : L1 Instruction Cache line prefetch requests > -event:0x45 counters:0,1,2,3 um:zero minimum:5000 name:L2_INST_PREFETCHES : Instruction Prefetch Requests > - > -# IA64_2 L1 Data Cache Events, Table 11-10 > -event:0xc8 counters:0,1,2,3 um:zero minimum:5000 name:DATA_EAR_EVENTS : Data Cache EAR Events > -# To avoid duplication from other tables the following events commented out > -#event:0xc2 counters:0,1,2,3 um:zero minimum:5000 name:L1D_READS_SET0 : L1 Data Cache Reads > -#event:0xc3 counters:0,1,2,3 um:zero minimum:5000 name:DATA_REFERENCES_SET0 : Data memory references issued to memory pipeline > -#event:0xc4 counters:0,1,2,3 um:zero minimum:5000 name:L1D_READS_SET1 : L1 Data Cache Reads > -#event:0xc5 counters:0,1,2,3 um:zero minimum:5000 name:DATA_REFERENCES_SET1 : Data memory references issued to memory pipeline > -#event:0xc7 counters:0,1,2,3 um:l1d_read_misses minimum:5000 name:L1D_READ_MISSES : L1 Data Cache Read Misses > - > -# IA64_2 L1 Data Cache Set 0 Events, Table 11-11 > -event:0xc0 counters:1 um:zero minimum:5000 name:L1DTLB_TRANSFER : L1DTLB misses that hit in the L2DTLB for accesses counted in L1D_READS > -event:0xc1 counters:1 um:zero minimum:5000 name:L2DTLB_MISSES : L2DTLB Misses > -event:0xc2 counters:1 um:zero minimum:5000 name:L1D_READS_SET0 : L1 Data Cache Reads > -event:0xc3 counters:1 um:zero minimum:5000 name:DATA_REFERENCES_SET0 : Data memory references issued to memory pipeline > - > -# IA64_2 L1 Data Cache Set 1 Events, Table 11-12 > -event:0xc4 counters:1 um:zero minimum:5000 name:L1D_READS_SET1 : L1 Data Cache Reads > -event:0xc5 counters:1 um:zero minimum:5000 name:DATA_REFERENCES_SET1 : Data memory references issued to memory pipeline > -event:0xc7 counters:1 um:l1d_read_misses minimum:5000 name:L1D_READ_MISSES : L1 Data Cache Read Misses > - > -# IA64_2 L1 Data Cache Set 2 Events, Table 11-13 > -event:0xca counters:1 um:be_l1d_fpu_bubble minimum:5000 name:BE_L1D_FPU_BUBBLE : Full pipe bubbles in main pipe due to FP or L1 dcache > - > -# IA64_2 L1 Data Cache Set 3 Events, Table 11-14 > -event:0xcd counters:1 um:zero minimum:5000 name:LOADS_RETIRED : Retired Loads > -event:0xce counters:1 um:zero minimum:5000 name:MISALIGNED_LOADS_RETIRED : Retired Misaligned Load Instructions > -event:0xcf counters:1 um:zero minimum:5000 name:UC_LOADS_RETIRED : Retired Uncacheable Loads > - > -# IA64_2 L1 Data Cache Set 4 Events, Table 11-15 > -event:0xd1 counters:1 um:zero minimum:5000 name:STORES_RETIRED : Retired Stores > -event:0xd2 counters:1 um:zero minimum:5000 name:MISALIGNED_STORES_RETIRED : Retired Misaligned Store Instructions > -event:0xd0 counters:1 um:zero minimum:5000 name:UC_STORES_RETIRED : Retired Uncacheable Stores > - > -# IA64_2 L2 Unified Cache Events, Table 11-16 > -# To avoid duplication from other tables the following events commented out > -#event:0xb9 counters:0,1,2,3 um:zero minimum:5000 name:L2_BAD_LINES_SELECTED : Valid line replaced when invalid line is available > -#event:0xb8 counters:0,1,2,3 um:l2_bypass minimum:5000 name:L2_BYPASS : Count bypass > -#event:0xb2 counters:0,1,2,3 um:l2_data_references minimum:5000 name:L2_DATA_REFERENCES : Data read/write access to L2 > -event:0xbf counters:0,1,2,3 um:zero minimum:5000 name:L2_FILLB_FULL : L2D Fill buffer is full > -#event:0xb4 counters:0,1,2,3 um:l2_force_recirc minimum:5000 name:L2_FORCE_RECIRC : Forced recirculates > -event:0xba counters:0,1,2,3 um:recirc_ifetch minimum:5000 name:L2_GOT_RECIRC_IFETCH : Instruction fetch recirculates received by L2D > -#event:0xb6 counters:0,1,2,3 um:zero minimum:5000 name:L2_GOT_RECIRC_OZQ_ACC : Counts number of OZQ accesses recirculated back to L1D > -#event:0xa1 counters:0,1,2,3 um:l2_ifet_cancels minimum:5000 name:L2_IFET_CANCELS : Instruction fetch cancels by the L2. > -#event:0xa5 counters:0,1,2,3 um:l2_ifet_cancels minimum:5000 name:L2_IFET_CANCELS : Instruction fetch cancels by the L2. > -#event:0xa9 counters:0,1,2,3 um:l2_ifet_cancels minimum:5000 name:L2_IFET_CANCELS : Instruction fetch cancels by the L2. > -#event:0xad counters:0,1,2,3 um:l2_ifet_cancels minimum:5000 name:L2_IFET_CANCELS : Instruction fetch cancels by the L2. > -event:0xb9 counters:0,1,2,3 um:recirc_ifetch minimum:5000 name:L2_ISSUED_RECIRC_IFETCH : Instruction fetch recirculates issued by L2D > -#event:0xb5 counters:0,1,2,3 um:zero minimum:5000 name:L2_ISSUED_RECIRC_OZQ_ACC : Count number of times a recirculate issue was attempted and not preempted > -#event:0xb0 counters:0,1,2,3 um:l2_l3_access_cancel minimum:5000 name:L2_L3ACCESS_CANCEL : Canceled L3 accesses > -event:0xcb counters:0,1,2,3 um:zero minimum:5000 name:L2_MISSES : L2 Misses > -event:0xb8 counters:0,1,2,3 um:l2_ops_issued minimum:5000 name:L2_OPS_ISSUED : Different operations issued by L2D > -#event:0xbd counters:0,1,2,3 um:zero minimum:5000 name:L2_OZDB_FULL : L2D OZQ is full > -#event:0xa2 counters:0,1,2,3 um:zero minimum:5000 name:L2_OZQ_ACQUIRE : Clocks with acquire ordering attribute existed in L2 OZQ > -#event:0xa6 counters:0,1,2,3 um:zero minimum:5000 name:L2_OZQ_ACQUIRE : Clocks with acquire ordering attribute existed in L2 OZQ > -#event:0xaa counters:0,1,2,3 um:zero minimum:5000 name:L2_OZQ_ACQUIRE : Clocks with acquire ordering attribute existed in L2 OZQ > -#event:0xae counters:0,1,2,3 um:zero minimum:5000 name:L2_OZQ_ACQUIRE : Clocks with acquire ordering attribute existed in L2 OZQ > -#event:0xa0 counters:0,1,2,3 um:l2_ozq_cancels0 minimum:5000 name:L2_OZQ_CANCELS0 : L2 OZQ cancels > -#event:0xac counters:0,1,2,3 um:l2_ozq_cancels1 minimum:5000 name:L2_OZQ_CANCELS1 : L2 OZQ cancels > -#event:0xa8 counters:0,1,2,3 um:l2_ozq_cancels2 minimum:5000 name:L2_OZQ_CANCELS2 : L2 OZQ cancels > -#event:0xbc counters:0,1,2,3 um:zero minimum:5000 name:L2_OZQ_FULL : L2D OZQ is full > -#event:0xa3 counters:0,1,2,3 um:zero minimum:5000 name:L2_OZQ_RELEASE : Clocks with release ordering attribute existed in L2 OZQ > -#event:0xa7 counters:0,1,2,3 um:zero minimum:5000 name:L2_OZQ_RELEASE : Clocks with release ordering attribute existed in L2 OZQ > -#event:0xab counters:0,1,2,3 um:zero minimum:5000 name:L2_OZQ_RELEASE : Clocks with release ordering attribute existed in L2 OZQ > -#event:0xaf counters:0,1,2,3 um:zero minimum:5000 name:L2_OZQ_RELEASE : Clocks with release ordering attribute existed in L2 OZQ > -#event:0xb1 counters:0,1,2,3 um:zero minimum:5000 name:L2_REFERENCES : Requests made from L2 > -#event:0xba counters:0,1,2,3 um:zero minimum:5000 name:L2_STORE_HIT_SHARED : Store hit a shared line > -#event:0xb7 counters:0,1,2,3 um:zero minimum:5000 name:L2_SYNTH_PROBE : Synthesized Probe > -#event:0xbe counters:0,1,2,3 um:zero minimum:5000 name:L2_VICTIMB_FULL : L2D victim buffer is full > - > -# IA64_2 L2 Cache Events Set 0, Table 11-18 > -# FIXME all sorts of restrictions on how these can be combined > -event:0xa1 counters:0 um:l2_ifet_cancels minimum:5000 name:L2_IFET_CANCELS : Instruction fetch cancels by the L2. > -event:0xa5 counters:0 um:l2_ifet_cancels minimum:5000 name:L2_IFET_CANCELS : Instruction fetch cancels by the L2. > -event:0xa9 counters:0 um:l2_ifet_cancels minimum:5000 name:L2_IFET_CANCELS : Instruction fetch cancels by the L2. > -event:0xad counters:0 um:l2_ifet_cancels minimum:5000 name:L2_IFET_CANCELS : Instruction fetch cancels by the L2. > -event:0xa2 counters:0 um:zero minimum:5000 name:L2_OZQ_ACQUIRE : Clocks with acquire ordering attribute existed in L2 OZQ > -event:0xa6 counters:0 um:zero minimum:5000 name:L2_OZQ_ACQUIRE : Clocks with acquire ordering attribute existed in L2 OZQ > -event:0xaa counters:0 um:zero minimum:5000 name:L2_OZQ_ACQUIRE : Clocks with acquire ordering attribute existed in L2 OZQ > -event:0xae counters:0 um:zero minimum:5000 name:L2_OZQ_ACQUIRE : Clocks with acquire ordering attribute existed in L2 OZQ > -event:0xa0 counters:0 um:l2_ozq_cancels0 minimum:5000 name:L2_OZQ_CANCELS0 : L2 OZQ cancels > -event:0xac counters:0 um:l2_ozq_cancels1 minimum:5000 name:L2_OZQ_CANCELS1 : L2 OZQ cancels > -event:0xa8 counters:0 um:l2_ozq_cancels2 minimum:5000 name:L2_OZQ_CANCELS2 : L2 OZQ cancels > -event:0xa3 counters:0 um:zero minimum:5000 name:L2_OZQ_RELEASE : Clocks with release ordering attribute existed in L2 OZQ > -event:0xa7 counters:0 um:zero minimum:5000 name:L2_OZQ_RELEASE : Clocks with release ordering attribute existed in L2 OZQ > -event:0xab counters:0 um:zero minimum:5000 name:L2_OZQ_RELEASE : Clocks with release ordering attribute existed in L2 OZQ > -event:0xaf counters:0 um:zero minimum:5000 name:L2_OZQ_RELEASE : Clocks with release ordering attribute existed in L2 OZQ > - > -# IA64_2 L2 Cache Events Set 1, Table 11-19 > -# manual states that L2_L3ACCESS_CANCEL must be measured in PMD4. > -# FIXME Don't have any way of enforcing the constraints > -# so only l2_l3_access_cancel allowed. > -event:0xb0 counters:0 um:l2_l3_access_cancel minimum:5000 name:L2_L3ACCESS_CANCEL : Canceled L3 accesses > -#event:0xb2 counters:0,1,2,3 um:l2_data_references minimum:5000 name:L2_DATA_REFERENCES : Data read/write access to L2 > -#event:0xb1 counters:0,1,2,3 um:zero minimum:5000 name:L2_REFERENCES : Requests made from L2 > - > -# IA64_2 L2 Cache Events Set 2, Table 11-20 > -# manual states that L2_FORCE_RECIRC must be measured in PMD4. > -# FIXME Don't have anyway of enforcing thes constraint > -# so only L2_FORCE_RECIRC allowed. > -event:0xb4 counters:0 um:l2_force_recirc minimum:5000 name:L2_FORCE_RECIRC : Forced recirculates > -#event:0xb5 counters:0,1,2,3 um:zero minimum:5000 name:L2_ISSUED_RECIRC_OZQ_ACC : Count number of times a recirculate issue was attempted and not preempted > -#event:0xb6 counters:0,1,2,3 um:zero minimum:5000 name:L2_GOT_RECIRC_OZQ_ACC : Counts number of OZQ accesses recirculated back to L1D > -#event:0xb7 counters:0,1,2,3 um:zero minimum:5000 name:L2_SYNTH_PROBE : Synthesized Probe > - > -# IA64_2 L2 Cache Events Set 3, Table 11-21 > -# The manual states that all events in this set share the same umask. > -event:0xb9 counters:0 um:zero minimum:5000 name:L2_BAD_LINES_SELECTED : Valid line replaced when invalid line is available > -event:0xb8 counters:0 um:l2_bypass minimum:5000 name:L2_BYPASS : Count bypass > -event:0xba counters:0 um:zero minimum:5000 name:L2_STORE_HIT_SHARED : Store hit a shared line > - > -# IA64_2 L2 Cache Events Set 4, Table 11-22 > -# The manual states one of the following needs to be in pmd4 and these events > -# share the same umask. > -event:0xba counters:0 um:recirc_ifetch minimum:5000 name:L2_GOT_RECIRC_IFETCH : Instruction fetch recirculates received by L2D > -event:0xb9 counters:0 um:recirc_ifetch minimum:5000 name:L2_ISSUED_RECIRC_IFETCH : Instruction fetch recirculates issued by L2D > -event:0xb8 counters:0 um:l2_ops_issued minimum:5000 name:L2_OPS_ISSUED : Different operations issued by L2D > - > -# IA64_2 L2 Cache Events Set 5, Table 11-23 > -# manual states one of the following needs to be in pmd4 and > -# these events share the same umask > -event:0xbc counters:0 um:zero minimum:5000 name:L2_OZQ_FULL : L2D OZQ is full > -event:0xbd counters:0 um:zero minimum:5000 name:L2_OZDB_FULL : L2D OZQ is full > -event:0xbe counters:0 um:zero minimum:5000 name:L2_VICTIMB_FULL : L2D victim buffer is full > -event:0xbf counters:0 um:zero minimum:5000 name:L2_FILLB_FULL : L2D Fill buffer is full > - > -# IA64_2 L3 Cache Events, Table 11-24 > -event:0xdf counters:0,1,2,3 um:zero minimum:5000 name:L3_LINES_REPLACED : Cache Lines Replaced > -event:0xdc counters:0,1,2,3 um:zero minimum:5000 name:L3_MISSES : L3 Misses > -event:0xdb counters:0,1,2,3 um:zero minimum:5000 name:L3_REFERENCES : L3 References > -event:0xdd counters:0,1,2,3 um:l3_reads minimum:5000 name:L3_READS : L3 Reads > -event:0xde counters:0,1,2,3 um:l3_writes minimum:5000 name:L3_WRITES : L3 Writes > - > -# IA64_2 System Events, Table 11-26 > -event:0x13 counters:0,1,2,3 um:zero minimum:5000 name:CPU_CPL_CHANGES : Privilege Level Changes > -event:0x52 counters:0,1,2,3 um:zero minimum:5000 name:DATA_DEBUG_REGISTER_FAULT : Fault due to data debug reg. Match to load/store instruction > -event:0xc6 counters:0,1,2,3 um:zero minimum:5000 name:DATA_DEBUG_REGISTER_MATCHES : Data debug register matches data address of memory reference > -event:0x9e counters:0,1,2,3 um:extern_dp_pins_0_to_3 minimum:5000 name:EXTERN_DP_PINS_0_TO_3 : DP pins 0-3 asserted > -event:0x9f counters:0,1,2,3 um:extern_dp_pins_4_to_5 minimum:5000 name:EXTERN_DP_PINS_4_TO_5 : DP pins 4-5 asserted > -event:0x53 counters:0,1,2,3 um:zero minimum:5000 name:SERIALIZATION_EVENTS : Number of srlz.I instructions > - > -# IA64_2 TLB Events, Table 11-28 > -event:0xc9 counters:0,1,2,3 um:zero minimum:5000 name:DTLB_INSERTS_HPW : Hardware Page Walker Installs to DTLB" > -event:0x2c counters:0,1,2,3 um:zero minimum:500 name:DTLB_INSERTS_HPW_RETIRED : VHPT entries inserted into DTLB by HW PW > -event:0x2d counters:0,1,2,3 um:zero minimum:500 name:HPW_DATA_REFERENCES : Data memory references to VHPT > -#event:0xc1 counters:1 um:zero minimum:5000 name:L2DTLB_MISSES : L2DTLB Misses > -event:0x48 counters:0,1,2,3 um:zero minimum:5000 name:L1ITLB_INSERTS_HPW : L1ITLB Hardware Page Walker Inserts > -event:0x47 counters:0,1,2,3 um:itlb_misses_fetch minimum:5000 name:ITLB_MISSES_FETCH : ITLB Misses Demand Fetch > -#event:0xc0 counters:1 um:zero minimum:5000 name:L1DTLB_TRANSFER : L1DTLB misses that hit in the L2DTLB for accesses counted in L1D_READS > - > -# IA64_2 System Bus Events, Table 11-30 > -event:0x87 counters:0,1,2,3 um:bus minimum:5000 name:BUS_ALL : Bus Transactions > -event:0x9c counters:0,1,2,3 um:zero minimum:5000 name:BUS_BRQ_LIVE_REQ_HI : BRQ Live Requests (two most-significant-bit of the 5-bit outstanding BRQ request count) > -event:0x9b counters:0,1,2,3 um:zero minimum:5000 name:BUS_BRQ_LIVE_REQ_LO : BRQ Live Requests (three least-significant-bit of the 5-bit outstanding BRQ request count > -event:0x9d counters:0,1,2,3 um:zero minimum:5000 name:BUS_BRQ_REQ_INSERTED : BRQ Requests Inserted > -event:0x88 counters:0,1,2,3 um:zero minimum:5000 name:BUS_DATA_CYCLE : Valid data cycle on the Bus > -event:0x84 counters:0,1,2,3 um:zero minimum:5000 name:BUS_HITM : Bus Hit Modified Line Transactions > -event:0x90 counters:0,1,2,3 um:bus minimum:5000 name:BUS_IO : IA-32 Compatible IO Bus Transactions > -event:0x98 counters:0,1,2,3 um:zero minimum:5000 name:BUS_IOQ_LIVE_REQ_HI : Inorder Bus Queue Requests (two most-significant-bit of the 4-bit outstanding IOQ request count) > -event:0x97 counters:0,1,2,3 um:zero minimum:5000 name:BUS_IOQ_LIVE_REQ_LO : Inorder Bus Queue Requests (two least-significant-bit of the 4-bit outstanding IOQ request count) > -event:0x93 counters:0,1,2,3 um:bus_lock minimum:5000 name:BUS_LOCK : IA-32 Compatible Bus Lock Transactions > -event:0x8e counters:0,1,2,3 um:bus_backsnp_req minimum:5000 name:BUS_BACKSNP_REQ : Bus Back Snoop Requests > -event:0x8a counters:0,1,2,3 um:bus_memory minimum:5000 name:BUS_MEMORY : Bus Memory Transactions > -event:0x8b counters:0,1,2,3 um:bus_mem_read minimum:5000 name:BUS_MEM_READ : Full Cache line D/I memory RD, RD invalidate, and BRIL > -event:0x94 counters:0,1,2,3 um:zero minimum:5000 name:BUS_MEM_READ_OUT_HI : Outstanding memory RD transactions > -event:0x95 counters:0,1,2,3 um:zero minimum:5000 name:BUS_MEM_READ_OUT_LO : Outstanding memory RD transactions > -event:0x9a counters:0,1,2,3 um:zero minimum:5000 name:BUS_OOQ_LIVE_REQ_HI : Out-of-order Bus Queue Requests (two most-significant-bit of the 4-bit outstanding OOQ request count) > -event:0x99 counters:0,1,2,3 um:zero minimum:5000 name:BUS_OOQ_LIVE_REQ_LO : Out-of-order Bus Queue Requests (three least-significant-bit of the 4-bit outstanding OOQ request count) > -event:0x8c counters:0,1,2,3 um:bus minimum:5000 name:BUS_RD_DATA : Bus Read Data Transactions > -event:0x80 counters:0,1,2,3 um:zero minimum:5000 name:BUS_RD_HIT : Bus Read Hit Clean Non-local Cache Transactions > -event:0x81 counters:0,1,2,3 um:zero minimum:5000 name:BUS_RD_HITM : Bus Read Hit Modified Non-local Cache Transactions > -event:0x83 counters:0,1,2,3 um:zero minimum:5000 name:BUS_RD_INVAL_ALL_HITM : Bus BIL or BRIL Transaction Results in HITM > -event:0x82 counters:0,1,2,3 um:zero minimum:5000 name:BUS_RD_INVAL_HITM : Bus BIL Transaction Results in HITM > -event:0x91 counters:0,1,2,3 um:bus minimum:5000 name:BUS_RD_IO : IA-32 Compatible IO Read Transactions > -event:0x8d counters:0,1,2,3 um:bus minimum:5000 name:BUS_RD_PRTL : Bus Read Partial Transactions > -event:0x96 counters:0,1,2,3 um:zero minimum:5000 name:BUS_SNOOPQ_REQ : Bus Snoop Queue Requests > -event:0x86 counters:0,1,2,3 um:bus minimum:5000 name:BUS_SNOOPS : Bus Snoops Total > -event:0x85 counters:0,1,2,3 um:bus_snoop minimum:5000 name:BUS_SNOOPS_HITM : Bus Snoops HIT Modified Cache Line > -event:0x8f counters:0,1,2,3 um:bus_snoop minimum:5000 name:BUS_SNOOP_STALL_CYCLES : Bus Snoop Stall Cycles (from any agent) > -event:0x92 counters:0,1,2,3 um:bus_wr_wb minimum:5000 name:BUS_WR_WB : Bus Write Back Transactions > -event:0x89 counters:0,1,2,3 um:mem_read_current minimum:5000 name:MEM_READ_CURRENT : Current Mem Read Transactions On Bus > - > -# RSE Events, Table 11-34 > -event:0x2b counters:0,1,2,3 um:zero minimum:500 name:RSE_CURRENT_REGS_2_TO_0 : Current RSE registers > -event:0x2a counters:0,1,2,3 um:zero minimum:500 name:RSE_CURRENT_REGS_5_TO_3 : Current RSE registers > -event:0x26 counters:0,1,2,3 um:zero minimum:500 name:RSE_CURRENT_REGS_6 : Current RSE registers > -event:0x29 counters:0,1,2,3 um:zero minimum:500 name:RSE_DIRTY_REGS_2_TO_0 : Dirty RSE registers > -event:0x28 counters:0,1,2,3 um:zero minimum:500 name:RSE_DIRTY_REGS_5_TO_3 : Dirty RSE registers > -event:0x24 counters:0,1,2,3 um:zero minimum:500 name:RSE_DIRTY_REGS_6 : Dirty RSE registers > -event:0x32 counters:0,1,2,3 um:zero minimum:500 name:RSE_EVENT_RETIRED : Retired RSE operations > -event:0x20 counters:0,1,2,3 um:rse_references_retired minimum:500 name:RSE_REFERENCES_RETIRED : RSE Accesses > - > -# IA64 Performance Monitors Ordered by Code, Table 11-36 > -event:0xbb counters:0,1,2,3 um:zero minimum:5000 name:TAGGED_L2_DATA_RETURN_POR : Tagged L2 Data Return Ports 0/1 > diff --git a/events/ia64/itanium2/unit_masks b/events/ia64/itanium2/unit_masks > deleted file mode 100644 > index bc74f5d..0000000 > --- a/events/ia64/itanium2/unit_masks > +++ /dev/null > @@ -1,465 +0,0 @@ > -# IA-64 Itanium 2 possible unit masks > -# > -# The information for the following entries for the Itanium 2 > -# came from Intel Itanium 2 Processor Reference Manual For > -# Software Development and Optimization, June 2002, Document > -# number 251110-001. > - > -name:zero type:mandatory default:0x0 > - 0x0 No unit mask > - > -# CPU_IA64_2 Table 11-37, 11-72 > -name:alat_capacity_miss type:bitmask default:0x03 > - 0x1 INT > - 0x2 FP > - 0x3 ALL > - > -# CPU_IA64_2 Table 11-38 > -name:back_end_bubble type:exclusive default:0x00 > - 0x0 ALL > - 0x1 FE > - 0x2 L1D_FPU_RSE > - > -# CPU_IA64_2 Table 11-39 > -name:be_br_mispredict_detail type:exclusive default:0x00 > - 0x0 ANY > - 0x1 STG > - 0x2 ROT > - 0x3 PFS > - > -# CPU_IA64_2 Table 11-40 > -name:be_exe_bubble type:exclusive default:0x00 > - 0x0 ALL > - 0x1 GRALL > - 0x2 FRALL > - 0x3 PR > - 0x4 ARCR > - 0x5 GRCR > - 0x6 CANCEL > - 0x7 BANK_SWITCH > - 0x8 ARCR_PR_CANCEL_BANK > - > -# CPU_IA64_2 Table 11-41 > -name:be_flush_bubble type:exclusive default:0x00 > - 0x0 ALL > - 0x1 BRU > - 0x2 XPN > - > -# CPU_IA64_2 Table 11-42 > -name:be_l1d_fpu_bubble type:exclusive default:0x00 > - 0x0 ALL > - 0x1 FPU > - 0x2 L1D > - 0x3 L1D_FULLSTBUF > - 0x4 L1D_DCURECIR > - 0x5 L1D_HPW > - 0x7 L1D_FILLCONF > - 0x8 L1D_DCS > - 0x9 L1D_L2BPRESS > - 0xa L1D_TLB > - 0xb L1D_LDCONF > - 0xc L1D_LDCHK > - 0xd L1D_NAT > - 0xe L1D_STBUFRECIR > - 0xf L1D_NATCONF > - > -# CPU_IA64_2 Table 11-43 > -# FIXME: events using this is commented out in events > -#name:be_lost_bw_due_to_fe type:exclusive default:0x00 > -# 0x0 ALL > -# 0x1 FEFLUSH > -# 0x4 UNREACHED > -# 0x5 IBFULL > -# 0x6 IMISS > -# 0x7 TLBMISS > -# 0x8 FILL_RECIRC > -# 0x9 BI > -# 0xa BRQ > -# 0xb PLP > -# 0xc BR_ILOCK > -# 0xd BUBBLE > - > -# CPU_IA64_2 Table 11-44 > -name:be_rse_bubble type:exclusive default:0x00 > - 0x0 ALL > - 0x1 BANK_SWITCH > - 0x2 AR_DEP > - 0x3 OVERFLOW > - 0x4 UNDERFLOW > - 0x5 LOADRS > - > -# CPU_IA64_2 Table 11-45 > -name:br_mispred_detail type:exclusive default:0x00 > - 0x0 ALL.ALL_PRED > - 0x1 ALL.CORRECT_PRED > - 0x2 ALL.WRONG_PATH > - 0x3 ALL.WRONG_TARGET > - 0x4 IPREL.ALL_PRED > - 0x5 IPREL.CORRECT_PRED > - 0x6 IPREL.WRONG_PATH > - 0x7 IPREL.WRONG_TARGET > - 0x8 RETURN.ALL_PRED > - 0x9 RETURN.CORRECT_PRED > - 0xa RETURN.WRONG_PATH > - 0xb RETURN.WRONG_TARGET > - 0xc NRETIND.ALL_PRED > - 0xd NRETIND.CORRECT_PRED > - 0xe NRETIND.WRONG_PATH > - 0xf NRETIND.WRONG_TARGET > - > -# CPU_IA64_2 Table 11-46 > -name:br_mispredict_detail2 type:exclusive default:0x00 > - 0x0 ALL.ALL_UNKNOWN_PRED > - 0x1 ALL.UKNOWN_PATH_CORRECT_PRED > - 0x2 ALL.UKNOWN_PATH_WRONG_PATH > - 0x4 IPREL.ALL_UNKNOWN_PRED > - 0x5 IPREL.UNKNOWN_PATH_CORRECT_PRED > - 0x6 IPREL.UNKNOWN_PATH_WRONG_PATH > - 0x8 RETURN.ALL_UNKNOWN_PRED > - 0x9 RETURN.UNKNOWN_PATH_CORRECT_PRED > - 0xa RETURN.UNKNOWN_PATH_WRONG_PATH > - 0xc NRETIND.ALL_UNKNOWN_PRED > - 0xd NRETIND.UNKNOWN_PATH_CORRECT_PRED > - 0xe NRETIND.UNKNOWN_PATH_WRONG_PATH > - > -# CPU_IA64_2 Table 11-47 > -name:br_path_pred type:exclusive default:0x00 > - 0x0 ALL.MISPRED_NOTTAKEN > - 0x1 ALL.MISPRED_TAKEN > - 0x2 ALL.OKPRED_NOTTAKEN > - 0x3 ALL.OKPRED_TAKEN > - 0x4 IPREL.MISPRED_NOTTAKEN > - 0x5 IPREL.MISPRED_TAKEN > - 0x6 IPREL.OKPRED_NOTTAKEN > - 0x7 IPREL.OKPRED_TAKEN > - 0x8 RETURN.MISPRED_NOTTAKEN > - 0x9 RETURN.MISPRED_TAKEN > - 0xa RETURN.OKPRED_NOTTAKEN > - 0xb RETURN.OKPRED_TAKEN > - 0xc NRETIND.MISPRED_NOTTAKEN > - 0xd NRETIND.MISPRED_TAKEN > - 0xe NRETIND.OKPRED_NOTTAKEN > - 0xf NRETIND.OKPRED_TAKEN > - > -# CPU_IA64_2 Table 11-48 > -name:br_path_pred2 type:exclusive default:0x00 > - 0x0 ALL.UNKNOWNPRED_NOTTAKEN > - 0x1 ALL.UNKNOWNPRED_TAKEN > - 0x4 IPREL.UNKNOWNPRED_NOTTAKEN > - 0x5 IPREL.UNKNOWNPRED__TAKEN > - 0x8 RETURN.UNKNOWNPRED_NOTTAKEN > - 0x9 RETURN.UNKNOWNPRED_TAKEN > - 0xc NRETIND.UNKNOWNPRED_NOTTAKEN > - 0xd NRETIND.UNKNOWNPRED_TAKEN > - > -# CPU_IA64_2 Table 11-49, 11-51, 11-55, 11-56, 11-57, 11-58 > -name:bus type:exclusive default:0x03 > - 0x1 IO > - 0x2 SELF > - 0x3 ANY > - > -# CPU_IA64_2 Table 11-50 b0001 > -name:bus_backsnp_req type:mandatory default:0x01 > - 0x1 0x0 > - > -# CPU_IA64_2 Table 11-52 > -name:bus_lock type:exclusive default:0x03 > - 0x2 SELF > - 0x3 ANY > - > -# CPU_IA64_2 Table 11-53 > -name:bus_memory type:exclusive default:0x0f > - 0x5 EQ_128BYTEIO > - 0x6 EQ_128BYTE_SELF > - 0x7 EQ_128BYTE_ANY > - 0x9 LT_128BYTEIO > - 0xa LT_128BYTE_SELF > - 0xb LT_128BYTE_ANY > - 0xd ALL IO > - 0xe ALL SELF > - 0xf ALL ANY > - > -# CPU_IA64_2 Table 11-54 > -name:bus_mem_read type:exclusive default:0x0f > - 0x1 BIL IO > - 0x2 BIL SELF > - 0x3 BIL ANY > - 0x5 BRL IO > - 0x6 BRL SELF > - 0x7 BRL_ANY > - 0x9 BRIL IO > - 0xa BRIL SELF > - 0xb BRIL ANY > - 0xd ALL IO > - 0xe ALL SELF > - 0xf ALL ANY > - > -# CPU_IA64_2 Table 11-59, 11-60 > -name:bus_snoop type:exclusive default:0x03 > - 0x2 SELF > - 0x3 ANY > - > -# CPU_IA64_2 Table 11-61 > -name:bus_wr_wb type:exclusive default:0x0f > - 0x5 EQ_128BYTE IO > - 0x6 EQ_128BYTE SELF > - 0x7 EQ_128BYTE ANY > - 0xa CCASTOUT SELF > - 0xb CCASTOUT ANY > - 0xd ALL IO > - 0xe ALL SELF > - 0xf ALL ANY > - > -# CPU_IA64_2 Table 11-62 > -name:encbr_mispred_detail type:exclusive default:0x0 > - 0x0 ALL.ALL_PRED > - 0x1 ALL.CORRECT_PRED > - 0x2 ALL.WRONG_PATH > - 0x3 ALL.WRONG_TARGET > - 0x8 OVERSUB.ALL_PRED > - 0x9 OVERSUB.CORRECT_PRED > - 0xa OVERSUB.CORRECT_PRED > - 0xb OVERSUB.WRONGPATH > - 0xc ALL2.ALL_PRED > - 0xd ALL2.CORRECT_PRED > - 0xe ALL2.WRONG_PATH > - 0xf ALL2.WRONG_TARGET > - > -# CPU_IA64_2 Table 11-63 > -name:extern_dp_pins_0_to_3 type:bitmask default:0xf > - 0x1 PIN0 > - 0x2 PIN1 > - 0x4 PIN2 > - 0x8 PIN3 > - 0xf ALL > - > -# CPU_IA64_2 Table 11-64 > -name:extern_dp_pins_4_to_5 type:bitmask default:0x03 > - 0x1 PIN4 > - 0x2 PIN5 > - 0xf ALL > - > -# CPU_IA64_2 Table 11-65 > -name:fe_bubble type:exclusive default:0x0 > - 0x0 ALL > - 0x1 FEFLUSH > - 0x3 GROUP1 > - 0x4 GROUP2 > - 0x5 IBFULL > - 0x6 IMISS > - 0x7 TLBMISS > - 0x8 FILL_RECIRC > - 0x9 BRANCH > - 0xa GROUP3 > - 0xb ALLBUT_FEFLUSH_BUBBLE > - 0xc ALLBUT_IBFULL > - 0xd BUBBLE > - > -# CPU_IA64_2 Table 11-66, 11-69*/ > -name:fe_lost type:exclusive default:0x0 > - 0x0 ALL > - 0x1 FEFLUSH > - 0x4 UNREACHED > - 0x5 IBFULL > - 0x6 IMISS > - 0x7 TLBMISS > - 0x8 FILL_RECIRC > - 0x9 BI > - 0xa BRQ > - 0xb PLP > - 0xc BR_ILOCK > - 0xd BUBBLE > - > -# CPU_IA64_2 Table 11-67, 11-79, 11-86, 11-90, 11-92 b0000 > -# FIXME: events using this is commented out in events > -#name:this type:exclusive default:0x0 > -# 0x0 THIS > - > -# CPU_IA64_2 Table 11-68 > -name:tagged_inst_retired type:exclusive default:0x0 > - 0x0 IBRP0_PMB8 > - 0x1 IBRP1_PMB9 > - 0x2 IBRP2_PMC8 > - 0x3 IBRP3_PMC9 > - > -# CPU_IA64_2 Table 11-73 > -name:itlb_misses_fetch type:exclusive default:0x3 > - 0x1 L1ITLB > - 0x2 L2ITLB > - 0x3 ALL > - > -# CPU_IA64_2 Table 11-74 > -name:l1d_read_misses type:exclusive default:0x0 > - 0x0 ALL > - 0x1 RSE_FILL > - > -# CPU_IA64_2 Table 11-75 > -name:l1i_prefetch_stall type:exclusive default:0x3 > - 0x2 FLOW > - 0x3 ALL > - > -# CPU_IA64_2 Table 11-76, 11-91 b0000 > -# FIXME: events using this is commented out in events > -#name:l2_lines type:exclusive default:0x0 > -# 0x0 ANY > - > -# CPU_IA64_2 Table 11-77 > -name:l2_bypass type:exclusive default:0x0 > - 0x0 L2_DATA1 > - 0x1 L2_DATA2 > - 0x2 L3_DATA1 > - 0x4 L2_INST1 > - 0x5 L2_INST2 > - 0x6 L3_INST1 > - > -# CPU_IA64_2 Table 11-78 > -# FIXME: events using this is commented out in events > -#name:l2_data_references type:bitmask default:0x3 > -# 0x1 L2_DATA_READS > -# 0x2 L2_DATA_WRITES > -# 0x3 L2_ALL > - > -# CPU_IA64_2 Table 11-80 > -name:l2_force_recirc type:exclusive default:0x0 > - 0x0 ANY > - 0x1 SMC_HIT > - 0x2 L1W > - 0x4 TAG_NOTOK > - 0x5 TRAN_PREF > - 0x6 SNP_OR_L3 > - 0x8 VIC_PEND > - 0x9 FILL_HIT > - 0xa IPF_MISS > - 0xb VIC_BUF_FULL > - 0xc OZQ_MISS > - 0xd SAME_INDEX > - 0xe FRC_RECIRC > - > -# CPU_IA64_2 Table 11-81, 11-83 b1000 > -name:recirc_ifetch type:mandatory default:0x8 > - 0x8 default:0x0} } }; > - > -# CPU_IA64_2 Table 11-82 > -name:l2_ifet_cancels type:exclusive default:0x0 > - 0x0 ANY > - 0x2 BYPASS > - 0x4 DIDNT_RECIR > - 0x5 RECIRC_OVER_SUB > - 0x6 ST_FILL_WB > - 0x7 DATA_RD > - 0x8 PREEMPT > - 0xc CHG_PRIO > - 0xd IFETCH_BYP > - > -# CPU_IA64_2 Table 11-84 > -name:l2_l3_access_cancel type:exclusive default:0x9 > - 0x1 SPEC_L3_BYP > - 0x2 FILLD_FULL > - 0x5 UC_BLOCKED > - 0x6 INV_L3_BYP > - 0x8 EBL_REJECT > - 0x9 ANY > - 0xa DFETCH > - 0xb IFETCH > - > -# CPU_IA64_2 Table 11-85 > -name:l2_ops_issued type:exclusive default:0x8 > - 0x8 INT_LOAD > - 0x9 FP_LOAD > - 0xa RMW > - 0xb STORE > - 0xc NST_NLD > - > -# CPU_IA64_2 Table 11-87 > -name:l2_ozq_cancels0 type:exclusive default:0x0 > - 0x0 ANY > - 0x1 LATE_SPEC_BYP > - 0x2 LATE_RELEASE > - 0x3 LATE_ACQUIRE > - 0x4 LATE_BYP_EFFRELEASE > - > -# CPU_IA64_2 Table 11-88 > -name:l2_ozq_cancels1 type:exclusive default:0x1 > - 0x0 REL > - 0x1 BANK_CONF > - 0x2 L2D_ST_MAT > - 0x4 SYNC > - 0x5 HPW_IFETCH_CONF > - 0x6 CANC_L2M_ST > - 0x7 L1_FILL_CONF > - 0x8 ST_FILL_CONF > - 0x9 CCV > - 0xa SEM > - 0xb L2M_ST_MAT > - 0xc MFA > - 0xd L2A_ST_MAT > - 0xe L1DF_L2M > - 0xf ECC > - > -# CPU_IA64_2 Table 11-89 > -name:l2_ozq_cancels2 type:exclusive default:0x0 > - 0x0 RECIRC_OVER_SUB > - 0x1 CANC_L2C_ST > - 0x2 L2C_ST_MAT > - 0x3 SCRUB > - 0x4 ACQ > - 0x5 READ_WB_CONF > - 0x6 OZ_DATA_CONF > - 0x8 L2FILL_ST_CONF > - 0x9 DIDNT_RECIRC > - 0xa WEIRD > - 0xc OVER_SUB > - 0xd CANC_L2D_ST > - 0xf D_IFET > - > -# CPU_IA64_2 Table 11-93 > -name:l3_reads type:exclusive default:0x3 > - 0x1 DINST_FETCH.HIT > - 0x2 DINST_FETCH.MISS > - 0x3 DINST_FETCH.ALL > - 0x5 INST_FETCH.HIT > - 0x6 INST_FETCH.MISS > - 0x7 INST_FETCH.ALL > - 0x9 DATA_READ.HIT > - 0xa DATA_READ.MISS > - 0xb DATA_READ.ALL > - 0xd ALL.HIT > - 0xe ALL.MISS > - 0xf ALL.ALL > - > -# CPU_IA64_2 Table 11-94 > -name:l3_writes type:exclusive default:0x7 > - 0x5 DATA_WRITE.HIT > - 0x6 DATA_WRITE.MISS > - 0x7 DATA_WRITE.ALL > - 0x9 L2_WB.HIT > - 0xa L2_WB.MISS > - 0xb L2_WB.ALL > - 0xd ALL.HIT > - 0xe ALL.MISS > - 0xf ALL.ALL > - > -# CPU_IA64_2 Table 11-95 > -name:mem_read_current type:exclusive default:0x3 > - 0x1 IO > - 0x3 ANY > - > -# CPU_IA64_2 Table 11-96 > -name:rse_references_retired type:bitmask default:0x3 > - 0x1 LOAD > - 0x2 STORE > - 0x3 ALL > - > -# CPU_IA64_2 Table 11-97 bitmask > -name:syll_not_dispersed type:bitmask default:0xf > - 0x1 EXPL > - 0x2 IMPL > - 0x4 FE > - 0x8 MLI > - 0xf ALL > - > -# CPU_IA64_2 Table 11-98 > -name:syll_overcount type:exclusive default:0x3 > - 0x1 EXPL > - 0x2 IMPL > - 0x3 ALL > diff --git a/events/ppc64/cell-be/events b/events/ppc64/cell-be/events > deleted file mode 100644 > index 3bcb393..0000000 > --- a/events/ppc64/cell-be/events > +++ /dev/null > @@ -1,517 +0,0 @@ > -#ppc64 Cell Broadband Engine events > -# > -# Copyright OProfile authors > -# > -#(C) COPYRIGHT International Business Machines Corp. 2006 > -# Contributed by Maynard Johnson <[email protected]> > -# > -# > -# As many as 4 signals may be specified when they are from the same group. > -# In some instances, signals from other groups in the same island or one > -# other island may also be specified. > -# > -# Each signal is assigned to a unique counter. There are 4 32-bit hardware > -# counters. The signals are defined in the Cell Broadband Engine > -# Performance manual. > -# > -# Each event is given a unique event number. The event number is used by the > -# Oprofile code to resolve event names for the postprocessing. This is done > -# to preserve compatibility with the rest of the Oprofile code. The event > -# number format group_num followed by the counter number for the event within > -# the group. > - > -# Signal Default > -event:0x1 counters:0,1,2,3 um:zero minimum:100000 name:CYCLES : Processor Cycles > -event:0x2 counters:0,1,2,3 um:zero minimum:60000 name:SPU_CYCLES : SPU Processor Cycles > - > - > -# Cell BE Island 2 - PowerPC Processing Unit (PPU) > - > -# CBE Signal Group 21 - PPU Instruction Unit - Group 1 (NClk) > -event:0x834 counters:0,1,2,3 um:PPU_01_edges minimum:10000 name:Branch_Commit : Branch instruction committed. > -event:0x835 counters:0,1,2,3 um:PPU_01_edges minimum:10000 name:Branch_Flush : Branch instruction that caused a misprediction flush is committed. Branch misprediction includes: (1) misprediction of taken or not-taken on conditional branch, (2) misprediction of branch target address on bclr[1] and bcctr[1]. > -event:0x836 counters:0,1,2,3 um:PPU_01_cycles minimum:10000 name:Ibuf_Empty : Instruction buffer empty. > -event:0x837 counters:0,1,2,3 um:PPU_01_edges minimum:10000 name:IERAT_Miss : Instruction effective-address-to-real-address translation (I-ERAT) miss. > -event:0x838 counters:0,1,2,3 um:PPU_01_cycles_or_edges minimum:10000 name:IL1_Miss_Cycles : L1 Instruction cache miss cycles. Counts the cycles from the miss event until the returned instruction is dispatched or cancelled due to branch misprediction, completion restart, or exceptions (see Note 1). > -event:0x83a counters:0,1,2,3 um:PPU_01_cycles minimum:10000 name:Dispatch_Blocked : Valid instruction available for dispatch, but dispatch is blocked. > -event:0x83d counters:0,1,2,3 um:PPU_01_edges minimum:10000 name:Instr_Flushed : Instruction in pipeline stage EX7 causes a flush. > -event:0x83f counters:0,1,2,3 um:PPU_01_edges minimum:10000 name:PPC_Commit : Two PowerPC instructions committed. For microcode sequences, only the last microcode operation is counted. Committed instructions are counted two at a time. If only one instruction has committed for a given cycle, this event will not be raised until another instruction has been committed in a future cycle. > - > - > -# CBE Signal Group 22 - PPU Execution Unit (NClk) > -event:0x89a counters:0,1,2,3 um:PPU_01_cycles minimum:10000 name:DERAT_Miss : Data effective-address-to-real-address translation (D-ERAT) miss. Not speculative. > -event:0x89b counters:0,1,2,3 um:PPU_01_cycles minimum:10000 name:Store_Request : Store request counted at the L2 interface. Counts microcoded PPE sequences more than once (see Note 1 for exceptions). (Thread 0 and 1) > -event:0x89c counters:0,1,2,3 um:PPU_01_cycles minimum:10000 name:Load_Valid : Load valid at a particular pipe stage. Speculative, since flushed operations are counted as well. Counts microcoded PPE sequences more than once. Misaligned flushes might be counted the first time as well. Load operations include all loads that read data from the cache, dcbt and dcbtst. Does not include load Vector/SIMD multimedia extension pattern instructions. > -event:0x89d counters:0,1,2,3 um:PPU_01_cycles minimum:10000 name:DL1_Miss : L1 D-cache load miss. Pulsed when there is a miss request that has a tag miss but not an ERAT miss. Speculative, since flushed operations are counted as well. > - > - > -# Cell BE Island 3 - PowerPC Storage Subsystem (PPSS) > - > -# CBE Signal Group 31 - PPSS Bus Interface Unit (NClk/2) > -event:0xc1c counters:0,1,2,3 um:PPU_2_edges minimum:10000 name:rcv_mmio_rd_ev : Load from MFC memory-mapped I/O (MMIO) space. > -event:0xc1d counters:0,1,2,3 um:PPU_2_edges minimum:10000 name:rcv_mmio_wr_ev : Stores to MFC MMIO space. > -event:0xc22 counters:0,1,2,3 um:PPU_2_edges minimum:10000 name:even_token_req_ev : Request token for even memory bank numbers 0-14. > -event:0xc2b counters:0,1,2,3 um:PPU_2_edges minimum:10000 name:rcv_data_ev : Receive 8-beat data from the Element Interconnect Bus (EIB). > -event:0xc2c counters:0,1,2,3 um:PPU_2_edges minimum:10000 name:send_data_ev : Send 8-beat data to the EIB. > -event:0xc2d counters:0,1,2,3 um:PPU_2_edges minimum:10000 name:send_cmd_ev : Send a command to the EIB; includes retried commands. > -event:0xc2e counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:dgnt_dly_cy : Cycles between data request and data grant. > -event:0xc33 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:nc_wr_not_emp_cy : The five-entry Non-Cacheable Unit (NCU) Store Command queue not empty. > - > - > -# CBE Signal Group 32 - PPSS L2 Cache Controller - Group 1 (NClk/2) > -event:0xc80 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:cache_hit : Cache hit for core interface unit (CIU) loads and stores. > -event:0xc81 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:cache_miss : Cache miss for CIU loads and stores. > -event:0xc84 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:load_miss : CIU load miss. > -event:0xc85 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:store_miss : CIU store to Invalid state (miss). > -event:0xc87 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:larx_miss_th1 : Load word and reserve indexed (lwarx/ldarx) for Thread 0 hits Invalid cache state > -event:0xc8e counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:stcx_miss_th1 : Store word conditional indexed (stwcx/stdcx) for Thread 0 hits Invalid cache state when reservation is set. > -event:0xc99 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:all_snp_busy : All four snoop state machines busy. > - > -# CBE Signal Group 33 - PPSS L2 Cache Controller - Group 2 (NClk/2) > -event:0xce8 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:dclaim_srt : Data line claim (dclaim) that received good combined response; includes store/stcx/dcbz to Shared (S), Shared Last (SL),or Tagged (T) cache state; does not include dcbz to Invalid (I) cache state (see Note 1). > -event:0xcef counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:dclaim_to_rwitm : Dclaim converted into rwitm; may still not get to the bus if stcx is aborted (see Note 2). > -event:0xcf0 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:store_mxe : Store to modified (M), modified unsolicited (MU), or exclusive (E) cache state. > -event:0xcf1 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:stq_full : 8-entry store queue (STQ) full. > -event:0xcf2 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:store_rc_ack : Store dispatched to RC machine is acknowledged. > -event:0xcf3 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:gather_store : Gatherable store (type = 00000) received from CIU. > -event:0xcf6 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:snp_push : Snoop push. > -event:0xcf7 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:intv_snode_er : Send intervention from (SL | E) cache state to a destination within the same CBE chip. > -event:0xcf8 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:intv_snode_mx : Send intervention from (M | MU) cache state to a destination within the same CBE chip. > -event:0xcfd counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:snp_retry : Respond with Retry to a snooped request due to one of the following conflicts: read-and-claim state machine (RC) full address, castout (CO) congruence class, snoop (SNP) machine full address, all snoop machines busy, directory lockout, or parity error. > -event:0xcfe counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:snp_busy_retry : Respond with Retry to a snooped request because all snoop machines are busy. > -event:0xcff counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:snp_mx_to_est : Snooped response causes a cache state transition from (M | MU) to (E | S | T). > -event:0xd00 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:snp_e_to_s : Snooped response causes a cache state transition from E to S. > -event:0xd01 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:snp_esrt_to_i : Snooped response causes a cache state transition from (E | SL | S | T) to Invalid (I). > -event:0xd02 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:snp_mx_to_i : Snooped response causes a cache state transition from (M | MU) to I. > - > -# CBE Signal Group 34 - PPSS L2 Cache Controller - Group 3 (NClk/2) > -event:0xd54 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:larx_miss : Load and reserve indexed (lwarx/ldarx) for Thread 1 hits Invalid cache state. > -event:0xd5b counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:stcx_miss_th2 : Store conditional indexed (stwcx/stdcx) for Thread 1 hits Invalid cache state. > - > -# CBE Signal Group 35 - PPSS Non-Cacheable Unit (NClk/2) > -event:0xdac counters:0,1,2,3 um:PPU_0_edges minimum:10000 name:st_req_any : Non-cacheable store request received from CIU; includes all synchronization operations such as sync and eieio. > -event:0xdad counters:0,1,2,3 um:PPU_0_edges minimum:10000 name:st_req_sync : sync received from CIU. > -event:0xdb0 counters:0,1,2,3 um:PPU_0_edges minimum:10000 name:st_req_store : Non-cacheable store request received from CIU; includes only stores. > -event:0xdb2 counters:0,1,2,3 um:PPU_0_edges minimum:10000 name:st_req_eieio : eieio received from CIU. > -event:0xdb3 counters:0,1,2,3 um:PPU_0_edges minimum:10000 name:st_req_tlbie : tlbie received from CIU. > -event:0xdb4 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:stq_bot_sync : sync at the bottom of the store queue, while waiting on st_done signal from the Bus Interface Unit (BIU) and sync_done signal from L2. > -event:0xdb5 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:stq_bot_lsync : lwsync at the bottom of the store queue, while waiting for a sync_done signal from the L2. > -event:0xdb6 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:stq_bot_eieio : eieio at the bottom of the store queue, while waiting for a st_done signal from the BIU and a sync_done signal from the L2. > -event:0xdb7 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:stq_bot_tlbieg : tlbie at the bottom of the store queue, while waiting for a st_done signal from the BIU. > -event:0xdb8 counters:0,1,2,3 um:PPU_0_edges minimum:10000 name:st_combined : Non-cacheable store combined with the previous non-cacheable store with a contiguous address. > -event:0xdb9 counters:0,1,2,3 um:PPU_0_edges minimum:10000 name:ld_cancel : Load request canceled by CIU due to late detection of load-hit-store condition (128B boundary). > -event:0xdba counters:0,1,2,3 um:PPU_0_edges minimum:10000 name:ld_hit_st : NCU detects a load hitting a previous store to an overlapping address (32B boundary). > -event:0xdbb counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:stb_full : All four store-gather buffers full. > -event:0xdbc counters:0,1,2,3 um:PPU_0_edges minimum:10000 name:ld_req : Non-cacheable load request received from CIU; includes instruction and data fetches. > -event:0xdbd counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:stq_not_empty : The four-deep store queue not empty. > -event:0xdbe counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:stq_full : The four-deep store queue full. > -event:0xdbf counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:stb_not_empty : At least one store gather buffer not empty. > - > -# Cell BE Island 4 - Synergistic Processor Unit (SPU) > -# > -# OPROFILE FOR CELL ONLY SUPPORTS PROFILING ON ONE SPU EVENT AT A TIME > -# > -# CBE Signal Group 41 - SPU (NClk) > -event:0x1004 counters:0 um:SPU_02_cycles minimum:10000 name:dual_instrctn_commit : Dual instruction committed. > -event:0x1005 counters:0 um:SPU_02_cycles minimum:10000 name:sngl_instrctn_commit : Single instruction committed. > -event:0x1006 counters:0 um:SPU_02_cycles minimum:10000 name:ppln0_instrctn_commit : Pipeline 0 instruction committed. > -event:0x1007 counters:0 um:SPU_02_cycles minimum:10000 name:ppln1_instrctn_commit : Pipeline 1 instruction committed. > -event:0x1008 counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:instrctn_ftch_stll : Instruction fetch stall. > -event:0x1009 counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:lcl_strg_bsy : Local storage busy. > -event:0x100A counters:0 um:SPU_02_cycles minimum:10000 name:dma_cnflct_ld_st : DMA may conflict with load or store. > -event:0x100B counters:0 um:SPU_02_cycles minimum:10000 name:str_to_lcl_strg : Store instruction to local storage issued. > -event:0x100C counters:0 um:SPU_02_cycles minimum:10000 name:ld_frm_lcl_strg : Load intruction from local storage issued. > -event:0x100D counters:0 um:SPU_02_cycles minimum:10000 name:fpu_exctn : Floating-Point Unit (FPU) exception. > -event:0x100E counters:0 um:SPU_02_cycles minimum:10000 name:brnch_instrctn_commit : Branch instruction committed. > -event:0x100F counters:0 um:SPU_02_cycles minimum:10000 name:change_of_flow : Non-sequential change of the SPU program counter, which can be caused by branch, asynchronous interrupt, stalled wait on channel, error correction code (ECC) error, and so forth. > -event:0x1010 counters:0 um:SPU_02_cycles minimum:10000 name:brnch_not_tkn : Branch not taken. > -event:0x1011 counters:0 um:SPU_02_cycles minimum:10000 name:brnch_mss_prdctn : Branch miss prediction; not exact. Certain other code sequences can cause additional pulses on this signal (see Note 2). > -event:0x1012 counters:0 um:SPU_02_cycles minimum:10000 name:brnch_hnt_mss_prdctn : Branch hint miss prediction; not exact. Certain other code sequences can cause additional pulses on this signal (see Note 2). > -event:0x1013 counters:0 um:SPU_02_cycles minimum:10000 name:instrctn_seqnc_err : Instruction sequence error. > -event:0x1015 counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:stlld_wait_on_chnl_wrt : Stalled waiting on any blocking channel write (see Note 3). > -event:0x1016 counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:stlld_wait_on_chnl0 : Stalled waiting on External Event Status (Channel 0) (see Note 3). > -event:0x1017 counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:stlld_wait_on_chnl3 : Stalled waiting on Signal Notification 1 (Channel 3) (see Note 3). > -event:0x1018 counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:stlld_wait_on_chnl4 : Stalled waiting on Signal Notification 2 (Channel 4) (see Note 3). > -event:0x1019 counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:stlld_wait_on_chnl21 : Stalled waiting on DMA Command Opcode or ClassID Register (Channel 21) (see Note 3). > -event:0x101A counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:stlld_wait_on_chnl24 : Stalled waiting on Tag Group Status (Channel 24) (see Note 3). > -event:0x101B counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:stlld_wait_on_chnl25 : Stalled waiting on List Stall-and-Notify Tag Status (Channel 25) (see Note 3). > -event:0x101C counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:stlld_wait_on_chnl28 : Stalled waiting on PPU Mailbox (Channel 28) (see Note 3). > -event:0x1022 counters:0 um:SPU_02_cycles_or_edges minimum:10000 name:stlld_wait_on_chnl29 : Stalled waiting on SPU Mailbox (Channel 29) (see Note 3). > - > - > -# CBE Signal Group 42 - SPU Trigger (NClk) > -event:0x10A1 counters:0 um:SPU_Trigger_cycles_or_edges minimum:10000 name:stld_wait_chnl_op : Stalled waiting on channel operation (See Note 2). > - > -# CBE Signal Group 43 - SPU Event (NClk) > -event:0x1107 counters:0 um:SPU_Event_cycles_or_edges minimum:10000 name:instrctn_ftch_stll : Instruction fetch stall. > - > -# Cell BE Island 6 - Element Interconnect Bus (EIB) > - > -# CBE Signal Group 61 - EIB Address Concentrator 0 (NClk/2) > -event:0x17d4 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(0) : Number of read and rwitm commands (including atomic) AC1 to AC0. (Group 1) > -event:0x17d5 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(1) : Number of dclaim commands (including atomic) AC1 to AC0. (Group 1) > -event:0x17d6 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(2) : Number of wwk, wwc, and wwf commands from AC1 to AC0. (Group 1) > -event:0x17d7 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(3) : Number of sync, tlbsync, and eieio commands from AC1 to AC0. (Group 1) > -event:0x17d8 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(4) : Number of tlbie commands from AC1 to AC0. (Group 1) > -event:0x17df counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_CAM_PERF(1) : Previous adjacent address match (PAAM) Content Addressable Memory (CAM) hit. (Group 1) > -event:0x17e0 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_CAM_PERF(2) : PAAM CAM miss. (Group 1) > -event:0x17e2 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_CAM_CMD_REFLECTED : Command reflected. (Group 1) > -event:0x17e4 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(0) : Number of read and rwitm commands (including atomic) AC1 to AC0. (Group 2) > -event:0x17e5 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(1) : Number of dclaim commands (including atomic) AC1 to AC0. (Group 2) > -event:0x17e6 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(2) : Number of wwk, wwc, and wwf commands from AC1 to AC0. (Group 2) > -event:0x17e7 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(3) : Number of sync, tlbsync, and eieio commands from AC1 to AC0. (Group 2) > -event:0x17e8 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_ICMD_PERF(4) : Number of tlbie commands from AC1 to AC0. (Group 2) > -event:0x17ef counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_CAM_PERF(1) : PAAM CAM hit. (Group 2) > -event:0x17f0 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_CAM_PERF(2) : PAAM CAM miss. (Group 2) > -event:0x17f2 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC0_W_CAM_CMD_REFLECTED : Command reflected. (Group 2) > - > -# CBE Signal Group 62 - EIB Address Concentrator 1 (NClk/2) > -event:0x1839 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(1) : Local command from SPE 6. > -event:0x183a counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(2) : Local command from SPE 4. > -event:0x183b counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(3) : Local command from SPE 2. > -event:0x183c counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(4) : Local command from SPE 0. > -event:0x183d counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(5) : Local command from PPE. > -event:0x183e counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(6) : Local command from SPE 1. > -event:0x183f counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(7) : Local command from SPE 3. > -event:0x1840 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(8) : Local command from SPE 5. > -event:0x1841 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(9) : Local command from SPE 7. > -event:0x1844 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(12) : AC1-to-AC0 global command from SPE 6. > -event:0x1845 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(13) : AC1-to-AC0 global command from SPE 4. > -event:0x1846 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(14) : AC1-to-AC0 global command from SPE 2. > -event:0x1847 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(15) : AC1-to-AC0 global command from SPE 0. > -event:0x1848 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(16) : AC1-to-AC0 global command from PPE. > -event:0x1849 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(17) : AC1-to-AC0 global command from SPE 1. > -event:0x184a counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(18) : AC1-to-AC0 global command from SPE 3. > -event:0x184b counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(19) : AC1-to-AC0 global command from SPE 5. > -event:0x184c counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(20) : AC1-to-AC0 global command from SPE 7. > -event:0x184f counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(23) : AC1 sends a global command to AC0. > -event:0x1850 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(24) : AC0 reflects a global command back to AC1. > -event:0x1851 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WAC1_WAC1_TRCMUX_W_TRCGRP_ACPERF(25) : AC1 reflects a command back to the bus masters. > - > -# CBE Signal Group 63 - EIB Data Ring Arbitrator - Group 1 (NClk/2) > -event:0x189c counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(0) : Grant on data ring 0. > -event:0x189d counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(1) : Grant on data ring 1. > -event:0x189e counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(2) : Grant on data ring 2. > -event:0x189f counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(3) : Grant on data ring 3. > -event:0x18a0 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPE(4) : Data ring 0 is in use. > -event:0x18a1 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPE(5) : Data ring 1 is in use. > -event:0x18a2 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPE(6) : Data ring 2 is in use. > -event:0x18a3 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPE(7) : Data ring 3 is in use. > -event:0x18a4 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPE(8) : All data rings are idle. > -event:0x18a5 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPE(9) : One data ring is busy. > -event:0x18a6 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPE(10) : Two or three data rings are busy. > -event:0x18a7 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPE(11) : All data rings are busy. > -event:0x18a8 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(12) : BIC data request pending. > -event:0x18a9 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(13) : SPE 6 data request pending. > -event:0x18aa counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(14) : SPE 4 data request pending. > -event:0x18ab counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(15) : SPE 2 data request pending. > -event:0x18ac counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(16) : SPE 0 data request pending. > -event:0x18ad counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(17) : MIC data request pending. > -event:0x18ae counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(18) : PPE data request pending. > -event:0x18af counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(19) : SPE 1 data request pending. > -event:0x18b0 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(20) : SPE 3 data request pending. > -event:0x18b1 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(21) : SPE 5 data request pending. > -event:0x18b2 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(22) : SPE 7 data request pending. > -event:0x18b3 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPE(23) : IOC data request pending. > -event:0x18b4 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(24) : BIC is data destination. > -event:0x18b5 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(25) : SPE 6 is data destination. > -event:0x18b6 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(26) : SPE 4 is data destination. > -event:0x18b7 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(27) : SPE 2 is data destination. > -event:0x18b8 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(28) : SPE 0 is data destination. > -event:0x18b9 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(29) : MIC is data destination. > -event:0x18ba counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(30) : PPE is data destination. > -event:0x18bb counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPE(31) : SPE 1 is data destination. > - > -# CBE Signal Group 64 - EIB Data Ring Arbitrator - Group 2 (NClk/2) > -event:0x1900 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(0) : BIC data request pending. > -event:0x1901 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(1) : SPE 6 data request pending. > -event:0x1902 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(2) : SPE 4 data request pending. > -event:0x1903 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(3) : SPE 2 data request pending. > -event:0x1904 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(4) : SPE 0 data request pending. > -event:0x1905 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(5) : MIC data request pending. > -event:0x1906 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(6) : PPE data request pending. > -event:0x1907 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(7) : SPE 1 data request pending. > -event:0x1908 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(8) : SPE 3 data request pending. > -event:0x1909 counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(9) : SPE 5 data request pending. > -event:0x190a counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(10) : SPE 7 data request pending. > -event:0x190b counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:WDA_DTRC_TRCGRPF(11) : IOC data request pending. > -event:0x190c counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(12) : BIC is data destination. > -event:0x190d counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(13) : SPE 6 is data destination. > -event:0x190e counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(14) : SPE 4 is data destination. > -event:0x190f counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(15) : SPE 2 is data destination. > -event:0x1910 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(16) : SPE 0 is data destination. > -event:0x1911 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(17) : MIC is data destination. > -event:0x1912 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(18) : PPE is data destination. > -event:0x1913 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(19) : SPE 1 is data destination. > -event:0x1914 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(20) : SPE 3 is data destination. > -event:0x1915 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(21) : SPE 5 is data destination. > -event:0x1916 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(22) : SPE 7 is data destination. > -event:0x1917 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(23) : IOC is data destination. > -event:0x1918 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(24) : Grant on data ring 0. > -event:0x1919 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(25) : Grant on data ring 1. > -event:0x191a counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(26) : Grant on data ring 2. > -event:0x191b counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:WDA_DTRC_TRCGRPF(27) : Grant on data ring 3. > -event:0x191c counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPF(28) : All data rings are idle. > -event:0x191d counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPF(29) : One data ring is busy. > -event:0x191e counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPF(30) : Two or three data rings are busy. > -event:0x191f counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:WDA_DTRC_TRCGRPF(31) : All four data rings are busy. > - > -# CBE Signal Group 651 - EIB Token Manager - Group A0/B0 (NClk/2) > -event:0xfe4c counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_e_unused : Even XIO token unused by RAG 0. > -event:0xfe4d counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_o_unused : Odd XIO token unused by RAG 0. > -event:0xfe4e counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_e_unused : Even bank token unused by RAG 0. > -event:0xfe4f counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_o_unused : Odd bank token unused by RAG 0. > -event:0xfe54 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:token_granted_spc0 : Token granted for SPE 0. > -event:0xfe55 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:token_granted_spc1 : Token granted for SPE 1. > -event:0xfe56 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:token_granted_spc2 : Token granted for SPE 2. > -event:0xfe57 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:token_granted_spc3 : Token granted for SPE 3. > -event:0xfe58 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:token_granted_spc4 : Token granted for SPE 4. > -event:0xfe59 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:token_granted_spc5 : Token granted for SPE 5. > -event:0xfe5a counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:token_granted_spc6 : Token granted for SPE 6. > -event:0xfe5b counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:token_granted_spc7 : Token granted for SPE 7. > - > - > -# CBE Signal Group 652 - EIB Token Manager - Group A1/B1 (NClk/2) > -event:0xfeb0 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_e_wasted : Even XIO token wasted by RAG 0; valid only when Unused Enable (UE) = 1 in TKM_CR register. > -event:0xfeb1 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_o_wasted : Odd XIO token wasted by RAG 0; valid only when Unused Enable (UE) = 1 in TKM_CR register. > -event:0xfeb2 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_e_wasted : Even bank token wasted by RAG 0; valid only when Unused Enable (UE) = 1 in TKM_CR register. > -event:0xfeb3 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_o_wasted : Odd bank token wasted by RAG 0; valid only when Unused Enable (UE) = 1 in TKM_CR register. > -event:0xfebc counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:ragu_xio_e_wasted : Even XIO token wasted by RAG U. > -event:0xfebd counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:ragu_xio_o_wasted : Odd XIO token wasted by RAG U. > -event:0xfebe counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:ragu_bank_e_wasted : Even bank token wasted by RAG U. > -event:0xfebf counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:ragu_bank_o_wasted : Odd bank token wasted by RAG U. > - > -# CBE Signal Group 653 - EIB Token Manager - Group A2/B2 (NClk/2) > -event:0xff14 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_e_shared_to_rag1 : Even XIO token from RAG 0 shared with RAG 1 > -event:0xff15 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_e_shared_to_rag2 : Even XIO token from RAG 0 shared with RAG 2 > -event:0xff16 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_e_shared_to_rag3 : Even XIO token from RAG 0 shared with RAG 3 > -event:0xff17 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_o_shared_to_rag1 : Odd XIO token from RAG 0 shared with RAG 1 > -event:0xff18 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_o_shared_to_rag2 : Odd XIO token from RAG 0 shared with RAG 2 > -event:0xff19 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_xio_o_shared_to_rag3 : Odd XIO token from RAG 0 shared with RAG 3 > -event:0xff1a counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_e_shared_to_rag1 : Even bank token from RAG 0 shared with RAG 1 > -event:0xff1b counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_e_shared_to_rag2 : Even bank token from RAG 0 shared with RAG 2 > -event:0xff1c counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_e_shared_to_rag3 : Even bank token from RAG 0 shared with RAG 3 > -event:0xff1d counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_o_shared_to_rag1 : Odd bank token from RAG 0 shared with RAG 1 > -event:0xff1e counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_o_shared_to_rag2 : Odd bank token from RAG 0 shared with RAG 2 > -event:0xff1f counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag0_bank_o_shared_to_rag3 : Odd bank token from RAG 0 shared with RAG 3 > - > - > -# CBE Signal Group 654 - EIB Token Manager - Group A0/B0 (NClk/2) > -# Repeat of the 65400, 65401, 65402, 65403, 65416, 65417, 65418, 65419 events > - > - > -# CBE Signal Group 655 - EIB Token Manager - Group A1/B1 (NClk/2) > -#repeat of the 65200 events > - > - > -# CBE Signal Group 656 - EIB Token Manager - Group A2/B2 (NClk/2) > -event:0x1004f counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:ragu_bank_o_shared_to_rag0 : Odd bank token from RAG U shared with RAG 0 > -event:0x10050 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_xio_e_shared_to_rag0 : Even XIO token from RAG 1 shared with RAG 0 > -event:0x10051 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_xio_e_shared_to_rag2 : Even XIO token from RAG 1 shared with RAG 2 > -event:0x10052 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_xio_e_shared_to_rag3 : Even XIO token from RAG 1 shared with RAG 3 > -event:0x10053 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_xio_o_shared_to_rag0 : Odd XIO token from RAG 1 shared with RAG 0 > -event:0x10054 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_xio_o_shared_to_rag2 : Odd XIO token from RAG 1 shared with RAG 2 > -event:0x10055 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_xio_o_shared_to_rag3 : Odd XIO token from RAG 1 shared with RAG 3 > -event:0x10056 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_bank_e_shared_to_rag0 : Even bank token from RAG 1 shared with RAG 0 > -event:0x10057 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_bank_e_shared_to_rag2 : Even bank token from RAG 1 shared with RAG 2 > -event:0x10058 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_bank_e_shared_to_rag3 : Even bank token from RAG 1 shared with RAG 3 > -event:0x10059 counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_bank_o_shared_to_rag0 : Odd bank token from RAG 1 shared with RAG 0 > -event:0x1005a counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_bank_o_shared_to_rag2 : Odd bank token from RAG 1 shared with RAG 2 > -event:0x1005b counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:rag1_bank_o_shared_to_rag3 : Odd bank token from RAG 1 shared with RAG 3 > -event:0x1005c counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:ragu_xio_e_shared_to_rag1 : Even XIO token from RAG U shared with RAG 1 > -event:0x1005d counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:ragu_xio_o_shared_to_rag1 : Odd XIO token from RAG U shared with RAG 1 > -event:0x1005e counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:ragu_bank_e_shared_to_rag1 : Even bank token from RAG U shared with RAG 1 > -event:0x1005f counters:0,1,2,3 um:PPU_0_cycles minimum:10000 name:ragu_bank_o_shared_to_rag1 : Odd bank token from RAG U shared with RAG 1 > - > -# CBE Signal Group 657 - EIB Token Manager - Group C0/D0 (NClk/2) > -event:0x100e4 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_e_unused : Even XIO token unused by RAG 2 > -event:0x100e5 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_o_unused : Odd XIO token unused by RAG 2 > -event:0x100e6 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_e_unused : Even bank token unused by RAG 2 > -event:0x100e7 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_o_unused : Odd bank token unused by RAG 2 > -event:0x100e8 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag0_ioif0_in_unused : IOIF0 In token unused by RAG 0 > -event:0x100e9 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag0_ioif0_out_unused : IOIF0 Out token unused by RAG 0 > -event:0x100ea counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag0_ioif1_in_unused : IOIF1 In token unused by RAG 0 > -event:0x100eb counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag0_ioif1_out_unused : IOIF1 Out token unused by RAG 0 > - > - > -# CBE Signal Group 658 - EIB Token Manager - Group C1/D1 (NClk/2) > -event:0x10148 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_e_wasted : Even XIO token wasted by RAG 2 > -event:0x10149 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_o_wasted : Odd XIO token wasted by RAG 2 > -event:0x1014a counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_e_wasted : Even bank token wasted by RAG 2 > -event:0x1014b counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_o_wasted : Odd bank token wasted by RAG 2 > - > - > -# CBE Signal Group 659 - EIB Token Manager - Group C2/D2 (NClk/2) > -event:0x101ac counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_e_shared_to_rag0 : Even XIO token from RAG 2 shared with RAG 0 > -event:0x101ad counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_e_shared_to_rag1 : Even XIO token from RAG 2 shared with RAG 1 > -event:0x101ae counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_e_shared_to_rag3 : Even XIO token from RAG 2 shared with RAG 3 > -event:0x101af counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_o_shared_to_rag0 : Odd XIO token from RAG 2 shared with RAG 0 > -event:0x101b0 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_o_shared_to_rag1 : Odd XIO token from RAG 2 shared with RAG 1 > -event:0x101b1 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_xio_o_shared_to_rag3 : Odd XIO token from RAG 2 shared with RAG 3 > -event:0x101b2 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_e_shared_to_rag0 : Even bank token from RAG 2 shared with RAG 0 > -event:0x101b3 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_e_shared_to_rag1 : Even bank token from RAG 2 shared with RAG 1 > -event:0x101b4 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_e_shared_to_rag3 : Even bank token from RAG 2 shared with RAG 3 > -event:0x101b5 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_o_shared_to_rag0 : Odd bank token from RAG 2 shared with RAG 0 > -event:0x101b6 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_o_shared_to_rag1 : Odd bank token from RAG 2 shared with RAG 1 > -event:0x101b7 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag2_bank_o_shared_to_rag3 : Odd bank token from RAG 2 shared with RAG 3 > - > - > -# CBE Signal Group 6510 - EIB Token Manager - Group C3 (NClk/2) > -event:0x9ef38 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag0_ioif0_in_wasted : IOIF0 In token wasted by RAG 0 > -event:0x9ef39 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag0_ioif0_out_wasted : IOIF0 Out token wasted by RAG 0 > -event:0x9ef3a counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag0_ioif1_in_wasted : IOIF1 In token wasted by RAG 0 > -event:0x9ef3b counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag0_ioif1_out_wasted : IOIF1 Out token wasted by RAG 0 > - > - > -# CBE Signal Group 6511 - EIB Token Manager - Group C0/D0 (NClk/2) > -# repeat of the events 65764 - 65771 > - > -# CBE Signal Group 6512 - EIB Token Manager - Group C1/D1 (NClk/2) > -event:0x9f010 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_xio_e_wasted : Even XIO token wasted by RAG 3 > -event:0x9f011 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_xio_o_wasted : Odd XIO token wasted by RAG 3 > -event:0x9f012 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_bank_e_wasted : Even bank token wasted by RAG 3 > -event:0x9f013 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_bank_o_wasted : Odd bank token wasted by RAG 3 > - > -# CBE Signal Group 6513 - EIB Token Manager - Group C2/D2 (NClk/2) > -event:0x9f074 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_xio_e_shared_to_rag0 : Even XIO token from RAG 3 shared with RAG 0 > -event:0x9f075 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_xio_e_shared_to_rag1 : Even XIO token from RAG 3 shared with RAG 1 > -event:0x9f076 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_xio_e_shared_to_rag2 : Even XIO token from RAG 3 shared with RAG 2 > -event:0x9f077 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_xio_o_shared_to_rag0 : Odd XIO token from RAG 3 shared with RAG 0 > -event:0x9f078 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_xio_o_shared_to_rag1 : Odd XIO token from RAG 3 shared with RAG 1 > -event:0x9f079 counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_xio_o_shared_to_rag2 : Odd XIO token from RAG 3 shared with RAG 2 > -event:0x9f07a counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_bank_e_shared_to_rag0 : Even bank token from RAG 3 shared with RAG 0 > -event:0x9f07b counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_bank_e_shared_to_rag1 : Even bank token from RAG 3 shared with RAG 1 > -event:0x9f07c counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_bank_e_shared_to_rag2 : Even bank token from RAG 3 shared with RAG 2 > -event:0x9f07d counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_bank_o_shared_to_rag0 : Odd bank token from RAG 3 shared with RAG 0 > -event:0x9f07e counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_bank_o_shared_to_rag1 : Odd bank token from RAG 3 shared with RAG 1 > -event:0x9f07f counters:0,1,2,3 um:PPU_2_cycles minimum:10000 name:rag3_bank_o_shared_to_rag2 : Odd bank token from RAG 3 shared with RAG 2 > - > - > -# Cell BE Island 7 - Memory Interface Controller (MIC) > - > -# CBE Signal Group 71 - MIC Group 1 (NClk/2) > -event:0x1bc5 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM1(1) : XIO1 - Read command queue is empty. > -event:0x1bc6 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM1(2) : XIO1 - Write command queue is empty. > -event:0x1bc8 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM1(4) : XIO1 - Read command queue is full. > -event:0x1bc9 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM1(5) : XIO1 - MIC responds with a Retry for a read command because the read command queue is full. > -event:0x1bca counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM1(6) : XIO1 - Write command queue is full. > -event:0x1bcb counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM1(7) : XIO1 - MIC responds with a Retry for a write command because the write command queue is full. > -event:0x1bde counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL1_YMM_CCS_PERFORM(2) : XIO1 - Read command dispatched; includes high-priority and fast-path reads (see Note 1). > -event:0x1bdf counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL1_YMM_CCS_PERFORM(3) : XIO1 - Write command dispatched (see Note 1). > -event:0x1be0 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL1_YMM_CCS_PERFORM(4) : XIO1 - Read-Modify-Write command (data size < 16 bytes) dispatched (see Note 1). > -event:0x1be1 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL1_YMM_CCS_PERFORM(5) : XIO1 - Refresh dispatched (see Note 1). > -event:0x1be3 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL1_YMM_CCS_PERFORM(7) : XIO1 - Byte-masking write command (data size >= 16 bytes) dispatched (see Note 1). > -event:0x1be5 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL1_YMM_CRW_PERFORM(1) : XIO1 - Write command dispatched after a read command was previously dispatched (see Note 1). > -event:0x1be6 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL1_YMM_CRW_PERFORM(2) : XIO1 - Read command dispatched after a write command was previously dispatched (see Note 1). > - > - > -# CBE Signal Group 72 - MIC Group 2 (NClk/2) > -event:0x1c29 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM2(1) : XIO0 - Read command queue is empty. > -event:0x1c2a counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM2(2) : XIO0 - Write command queue is empty. > -event:0x1c2c counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM2(4) : XIO0 - Read command queue is full. > -event:0x1c2d counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM2(5) : XIO0 - MIC responds with a Retry for a read command because the read command queue is full. > -event:0x1c2e counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM2(6) : XIO0 - Write command queue is full. > -event:0x1c2f counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_COMMON_YMB_CSR_PERFORM2(7) : XIO0 - MIC responds with a Retry for a write command because the write command queue is full. > -event:0x1c42 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CCS_PERFORM(2) : XIO0 - Read command dispatched; includes high-priority and fast-path reads (see Note 1). > -event:0x1c43 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CCS_PERFORM(3) : XIO0 - Write command dispatched (see Note 1). > -event:0x1c44 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CCS_PERFORM(4) : XIO0 - Read-Modify-Write command (data size < 16 bytes) dispatched (see Note 1). > -event:0x1c45 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CCS_PERFORM(5) : XIO0 - Refresh dispatched (see Note 1). > -event:0x1c49 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CRW_PERFORM(1) : XIO0 - Write command dispatched after a read command was previously dispatched (see Note 1). > -event:0x1c4a counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CRW_PERFORM(2) : XIO0 - Read command dispatched after a write command was previously dispatched (see Note 1). > - > -# CBE Signal Group 73 - MIC Group 3 (NClk/2) > -event:0x1ca7 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CCS_PERFORM(3) : XIO0 - Write command dispatched (see Note 1). > -event:0x1ca8 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CCS_PERFORM(4) : XIO0 - Read-Modify-Write command (data size < 16 bytes) dispatched (see Note 1). > -event:0x1ca9 counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CCS_PERFORM(5) : XIO0 - Refresh dispatched (see Note 1). > -event:0x1cab counters:0,1,2,3 um:PPU_0123_cycles minimum:10000 name:YM_CTL0_YMM_CCS_PERFORM(7) : XIO0 - Byte-masking write command (data size >= 16 bytes) dispatched (see Note 1). > - > - > -# Cell BE Island 8 - Broadband Engine Interface (BEI) > - > -# CBE Signal Group 81 - BIF Controller - IOIF0 Word 0 (NClk/2) > -event:0x1fb0 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:B2F_Type_A_Data : Type A data physical layer group (PLG). Does not include header-only or credit-only data PLGs. In IOIF mode, counts I/O device read data; in BIF mode, counts all outbound data. > -event:0x1fb1 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:B2F_Type_B_Data : Type B data PLG. In IOIF mode, counts I/O device read data; in BIF mode, counts all outbound data. > -event:0x1fb2 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:IOC_Type_A_Data : Type A data PLG. Does not include header-only or credit-only PLGs. In IOIF mode, counts CBE store data to I/O device. Does not apply in BIF mode. > -event:0x1fb3 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:IOC_Type_B_Data : Type B data PLG. In IOIF mode, counts CBE store data to an I/O device. Does not apply in BIF mode. > -event:0x1fb4 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Data_PLG : Data PLG. Does not include header-only or credit-only PLGs. > -event:0x1fb5 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Command_PLG : Command PLG (no credit-only PLG). In IOIF mode, counts I/O command or reply PLGs. In BIF mode, counts command/ reflected command or snoop/combined responses. > -event:0x1fb6 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Type_A_Transfer : Type A data transfer regardless of length. Can also be used to count Type A data header PLGs (but not credit-only PLGs). > -event:0x1fb7 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Type_B_Transfer : Type B data transfer. > -event:0x1fb8 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Cmd_Credit_Only_PLG : Command-credit-only command PLG in either IOIF or BIF mode. > -event:0x1fb9 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Data_Credit_Only_PLG : Data-credit-only data PLG sent in either IOIF or BIF mode. > -event:0x1fba counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Non-Null_Envelopes : Non-null envelope sent (does not include long envelopes). > -event:0x1fbc counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:null_env_sent : Null envelope sent (see Note 1). > -event:0x1fbd counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:no_valid_data : No valid data sent this cycle (see Note 1). > -event:0x1fbe counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:norm_env_sent : Normal envelope sent (see Note 1). > -event:0x1fbf counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:lnog_env_sent : Long envelope sent (see Note 1). > -event:0x1fc0 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:per_mon_null_sent : A Null PLG inserted in an outgoing envelope. > -event:0x1fc1 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:per_mon_array_full : Outbound envelope array is full. > - > -# CBE Signal Group 82 - BIF Controller - IOIF1 Word 0 (NClk/2) > -event:0x201b counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Type_B_Transfer : Type B data transfer. > - > - > -# CBE Signal Group 83 - BIF Controller - IOIF0 Word 2 (NClk/2) > -event:0x206d counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:null_env_rcvd : Null envelope received (see Note 1). > -event:0x207a counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Command_PLG : Command PLG, but not credit-only PLG. In IOIF mode, counts I/O command or reply PLGs. In BIF mode, counts command/reflected command or snoop/combined responses. > -event:0x207b counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Command_Credit_Only_PLG : Command-credit-only command PLG. > -event:0x2080 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:norm_env_rcvd_good : Normal envelope received is good (see Note 1). > -event:0x2081 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:long_env_rcvd_good : Long envelope received is good (see Note 1). > -event:0x2082 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:cmd_credit_only_PLG : Data-credit-only data PLG in either IOIF or BIF mode; will count a maximum of one per envelope (see Note 1). > -event:0x2083 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:non-null_envelope : Non-null envelope; does not include long envelopes; includes retried envelopes (see Note 1). > -event:0x2084 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:data_grnt_rcvd : Data grant received. > -event:0x2088 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Data_PLG : Data PLG. Does not include header-only or credit-only PLGs. > -event:0x2089 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Type_A_transfer : Type A data transfer regardless of length. Can also be used to count Type A data header PLGs, but not credit-only PLGs. > -event:0x208a counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Type_B_transfer : Type B data transfer. > - > -# CBE Signal Group 84 - BIF Controller - IOIF1 Word 2 (NClk/2) > -event:0x20d1 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:null_env_rcvd : Null envelope received (see Note 1). > -event:0x20de counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Command_PLG : Command PLG (no credit-only PLG). Counts I/O command or reply PLGs. > -event:0x20df counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Command_Credit_Only_PLG : Command-credit-only command PLG. > -event:0x20e4 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:norm_env_rcvd_good : Normal envelope received is good (see Note 1). > -event:0x20e5 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:long_env_rcvd_good : Long envelope received is good (see Note 1). > -event:0x20e6 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:cmd_credit_only_PLG : Data-credit-only data PLG received; will count a maximum of one per envelope (see Note 1). > -event:0x20e7 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:non-null_envelope : Non-Null envelope received; does not include long envelopes; includes retried envelopes (see Note 1). > -event:0x20e8 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:data_grnt_rcvd : Data grant received. > -event:0x20ec counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Data_PLG : Data PLG received. Does not include header-only or credit-only PLGs. > -event:0x20ed counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Type_A_transfer : Type I A data transfer regardless of length. Can also be used to count Type A data header PLGs (but not credit-only PLGs). > -event:0x20ee counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:Type_B_transfer : Type B data transfer received. > - > -# CBE Signal Group 85 - I/O Controller Word 0 - Group 1 (NClk/2) > -event:0x213c counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:mmio_rd_to_ioif1 : Received MMIO read targeted to IOIF1. > -event:0x213d counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:mmio_wrt_to_ioif1 : Received MMIO write targeted to IOIF1. > -event:0x213e counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:mmio_rd_to_ioif0 : Received MMIO read targeted to IOIF0. > -event:0x213f counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:mmio_wrt_to_ioif0 : Received MMIO write targeted to IOIF0. > -event:0x2140 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:cmd_to_slice0 : Sent command to IOIF0. > -event:0x2141 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:cmd_to_slice1 : Sent command to IOIF1. > - > -# CBE Signal Group 86 - I/O Controller Word 2 - Group 2 (NClk/2) > -event:0x219d counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:re_dep_dm3 : IOIF0 Dependency Matrix 3 is occupied by a dependent command (see Note 1). > -event:0x219e counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:re_dep_dm4 : IOIF0 Dependency Matrix 4 is occupied by a dependent command (see Note 1). > -event:0x219f counters:0,1,2,3 um:PPU_02_cycles_or_edges minimum:10000 name:re_dep_dm5 : IOIF0 Dependency Matrix 5 is occupied by a dependent command (see Note 1). > -event:0x21a2 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:slice0_ld_rqst : Received read request from IOIF0. > -event:0x21a3 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:slice0_str_rqst : Received write request from IOIF0. > -event:0x21a6 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:intrpt_from_realizer : Received interrupt from the IOIF0. > - > -# CBE Signal Group 87 - I/O Controller - Group 3 (NClk/2) > -event:0x220c counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:slice0_rqst_tkn_even : IOIF0 request for token for even memory banks 0-14 (see Note 1). > -event:0x220d counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:slice0_rqst_tkn_odd : IOIF0 request for token for odd memory banks 1-15 (see Note 1). > -event:0x220e counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:slice0_rqst_tkn1_3_5_7 : IOIF0 request for token type 1, 3, 5, or 7 (see Note 1). > -event:0x220f counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:slice0_rqst_tkn9_11_13_15 : IOIF0 request for token type 9, 11, 13, or 15 (see Note 1). > -event:0x2214 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:slice0_rqst_tkn16 : IOIF0 request for token type 16 (see Note 1). > -event:0x2215 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:slice0_rqst_tkn17 : IOIF0 request for token type 17 (see Note 1). > -event:0x2216 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:slice0_rqst_tkn18 : IOIF0 request for token type 18 (see Note 1). > -event:0x2217 counters:0,1,2,3 um:PPU_02_cycles minimum:10000 name:slice0_rqst_tkn19 : IOIF0 request for token type 19 (see Note 1). > - > - > -# CBE Signal Group 88 - I/O Controller Word 0 - Group 4 (NClk/2) > -event:0x2260 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:io_pt_hit : I/O page table cache hit for commands from IOIF. > -event:0x2261 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:io_pt_miss : I/O page table cache miss for commands from IOIF. > -event:0x2263 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:io_seg_tbl_hit : I/O segment table cache hit. > -event:0x2264 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:io_seg_tbl_miss : I/O segment table cache miss. > -event:0x2278 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:intrrpt_frm_spu : Interrupt received from any SPU (reflected cmd when IIC has sent ACK response). > -event:0x2279 counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:iic_intrrpt_to_pu_thrd0 : Internal interrupt controller (IIC) generated interrupt to PPU thread 0. > -event:0x227a counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:iic_intrrpt_to_pu_thrd1 : IIC generated interrupt to PPU thread 1. > -event:0x227b counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:pu_intrrpt_to_pu_thrd0 : Received external interrupt (using MMIO) from PPU to PPU thread 0. > -event:0x227c counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:pu_intrrpt_to_pu_thrd1 : Received external interrupt (using MMIO) from PPU to PPU thread 1. > -event:0x227c counters:0,1,2,3 um:PPU_02_edges minimum:10000 name:pu_intrrpt_to_pu_thrd1 : Received external interrupt (using MMIO) from PPU to PPU thread 1. > diff --git a/events/ppc64/cell-be/unit_masks b/events/ppc64/cell-be/unit_masks > deleted file mode 100644 > index 64a4959..0000000 > --- a/events/ppc64/cell-be/unit_masks > +++ /dev/null > @@ -1,137 +0,0 @@ > -# Cell Broadband Engine possible unit masks > -# > -# Copyright OProfile authors > -# > -#(C) COPYRIGHT International Business Machines Corp. 2006 > -# Contributed by Maynard Johnson <[email protected]> > -# > -# > -name:zero type:mandatory default:0x0 > - 0x000 Count cycles [mandatory] > -name:PPU_0_cycles type:bitmask default:0x013 > - 0x001 Count cycles [mandatory] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x010 PPU Bus Word 0 [mandatory] > -name:PPU_0_edges type:bitmask default:0x012 > - 0x000 Count edges [mandatory] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x010 PPU Bus Word 0 [mandatory] > -name:PPU_2_cycles type:bitmask default:0x043 > - 0x001 Count cycles [mandatory] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x040 PPU Bus Word 2 [mandatory] > -name:PPU_2_edges type:bitmask default:0x042 > - 0x000 Count edges [mandatory] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x040 PPU Bus Word 2 [mandatory] > -name:PPU_01_cycles type:bitmask default:0x023 > - 0x001 Count cycles [mandatory] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x010 PPU Bus Word 0 [optional ] > - 0x020 PPU Bus Word 1 [default ] > -name:PPU_01_edges type:bitmask default:0x022 > - 0x000 Count edges [mandatory] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x010 PPU Bus Word 0 [optional ] > - 0x020 PPU Bus Word 1 [default ] > -name:PPU_01_cycles_or_edges type:bitmask default:0x023 > - 0x000 Count edges [optional ] > - 0x001 Count cycles [default ] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x010 PPU Bus Word 0 [optional ] > - 0x020 PPU Bus Word 1 [default ] > -name:PPU_02_cycles type:bitmask default:0x013 > - 0x001 Count cycles [mandatory] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x010 PPU Bus Word 0 [default ] > - 0x040 PPU Bus Word 2 [optional ] > -name:PPU_02_edges type:bitmask default:0x012 > - 0x000 Count edges [mandatory] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x010 PPU Bus Word 0 [default ] > - 0x040 PPU Bus Word 2 [optional ] > -name:PPU_02_cycles_or_edges type:bitmask default:0x013 > - 0x000 Count edges [optional ] > - 0x001 Count cycles [default ] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x010 PPU Bus Word 0 [default ] > - 0x040 PPU Bus Word 2 [optional ] > -name:PPU_0123_cycles type:bitmask default:0x033 > - 0x001 Count cycles [mandatory] > - 0x000 Negative polarity [optional ] > - 0x002 Positive polarity [default ] > - 0x030 PPU Bus Word 0/1 [default ] > - 0x0c0 PPU Bus Word 2/3 [optional ] > -name:SPU_02_cycles type:bitmask default:0x0113 > - 0x0001 Count cycles [mandatory] > - 0x0000 Negative polarity [optional ] > - 0x0002 Positive polarity [default ] > - 0x0110 SPU Bus Word 0 [default ] > - 0x0140 SPU Bus Word 2 [optional ] > - 0x0000 SPU 0 [default ] > - 0x1000 SPU 1 [optional ] > - 0x2000 SPU 2 [optional ] > - 0x3000 SPU 3 [optional ] > - 0x4000 SPU 4 [optional ] > - 0x5000 SPU 5 [optional ] > - 0x6000 SPU 6 [optional ] > - 0x7000 SPU 7 [optional ] > -name:SPU_02_cycles_or_edges type:bitmask default:0x0113 > - 0x0000 Count edges [optional ] > - 0x0001 Count cycles [default ] > - 0x0000 Negative polarity [optional ] > - 0x0002 Positive polarity [default ] > - 0x0110 SPU Bus Word 0 [default ] > - 0x0140 SPU Bus Word 2 [optional ] > - 0x0000 SPU 0 [default ] > - 0x1000 SPU 1 [optional ] > - 0x2000 SPU 2 [optional ] > - 0x3000 SPU 3 [optional ] > - 0x4000 SPU 4 [optional ] > - 0x5000 SPU 5 [optional ] > - 0x6000 SPU 6 [optional ] > - 0x7000 SPU 7 [optional ] > -name:SPU_Trigger_cycles_or_edges type:bitmask default:0x0107 > - 0x0000 Count edges [optional ] > - 0x0001 Count cycles [default ] > - 0x0000 Negative polarity [optional ] > - 0x0002 Positive polarity [default ] > - 0x0104 SPU Trigger 0 [default ] > - 0x0114 SPU Trigger 1 [optional ] > - 0x0124 SPU Trigger 2 [optional ] > - 0x0134 SPU Trigger 3 [optional ] > - 0x0000 SPU 0 [default ] > - 0x1000 SPU 1 [optional ] > - 0x2000 SPU 2 [optional ] > - 0x3000 SPU 3 [optional ] > - 0x4000 SPU 4 [optional ] > - 0x5000 SPU 5 [optional ] > - 0x6000 SPU 6 [optional ] > - 0x7000 SPU 7 [optional ] > -name:SPU_Event_cycles_or_edges type:bitmask default:0x0147 > - 0x0000 Count edges [optional ] > - 0x0001 Count cycles [default ] > - 0x0000 Negative polarity [optional ] > - 0x0002 Positive polarity [default ] > - 0x0144 SPU Event 0 [default ] > - 0x0154 SPU Event 1 [optional ] > - 0x0164 SPU Event 2 [optional ] > - 0x0174 SPU Event 3 [optional ] > - 0x0000 SPU 0 [default ] > - 0x1000 SPU 1 [optional ] > - 0x2000 SPU 2 [optional ] > - 0x3000 SPU 3 [optional ] > - 0x4000 SPU 4 [optional ] > - 0x5000 SPU 5 [optional ] > - 0x6000 SPU 6 [optional ] > - 0x7000 SPU 7 [optional ] > diff --git a/events/ppc64/ibm-compat-v1/event_mappings b/events/ppc64/ibm-compat-v1/event_mappings > deleted file mode 100644 > index 5805604..0000000 > --- a/events/ppc64/ibm-compat-v1/event_mappings > +++ /dev/null > @@ -1,82 +0,0 @@ > -#PPC64 pmu-compat event mappings, version 1 > -# > -# Copyright OProfile authors > -# Copyright (c) International Business Machines, 2009. > -# Contributed by Maynard Johnson <[email protected]>. > -# > -#Mapping of event groups to MMCR values > - > -#Group Default > -event:0X001 mmcr0:0X00000000 mmcr1:0X00000000FAF41EF4 mmcra:0X00000000 > - > -#Group 1 pm_compat_utilization1, Basic CPU utilization > -event:0X0010 mmcr0:0X00000000 mmcr1:0X00000000FAF41EF4 mmcra:0X00000000 > -event:0X0011 mmcr0:0X00000000 mmcr1:0X00000000FAF41EF4 mmcra:0X00000000 > -event:0X0012 mmcr0:0X00000000 mmcr1:0X00000000FAF41EF4 mmcra:0X00000000 > -event:0X0013 mmcr0:0X00000000 mmcr1:0X00000000FAF41EF4 mmcra:0X00000000 > - > -#Group 2 pm_compat_utilization2, CPI and utilization data > -event:0X0020 mmcr0:0X00000000 mmcr1:0X00000000F4F41EFA mmcra:0X00000000 > -event:0X0021 mmcr0:0X00000000 mmcr1:0X00000000F4F41EFA mmcra:0X00000000 > -event:0X0022 mmcr0:0X00000000 mmcr1:0X00000000F4F41EFA mmcra:0X00000000 > -event:0X0023 mmcr0:0X00000000 mmcr1:0X00000000F4F41EFA mmcra:0X00000000 > - > -#Group 3 pm_compat_dsource, Data Access sources > -event:0X0030 mmcr0:0X00000000 mmcr1:0X00000000FEFEFEFA mmcra:0X00000000 > -event:0X0031 mmcr0:0X00000000 mmcr1:0X00000000FEFEFEFA mmcra:0X00000000 > -event:0X0032 mmcr0:0X00000000 mmcr1:0X00000000FEFEFEFA mmcra:0X00000000 > -event:0X0033 mmcr0:0X00000000 mmcr1:0X00000000FEFEFEFA mmcra:0X00000000 > - > -#Group 4 pm_compat_l1_dcache_load_store_miss, L1 D-Cache load/store miss > -event:0X0040 mmcr0:0X00000000 mmcr1:0X0000000002F0F0F0 mmcra:0X00000000 > -event:0X0041 mmcr0:0X00000000 mmcr1:0X0000000002F0F0F0 mmcra:0X00000000 > -event:0X0042 mmcr0:0X00000000 mmcr1:0X0000000002F0F0F0 mmcra:0X00000000 > -event:0X0043 mmcr0:0X00000000 mmcr1:0X0000000002F0F0F0 mmcra:0X00000000 > - > -#Group 5 pm_compat_l1_cache_load, L1 Cache loads > -event:0X0050 mmcr0:0X00000000 mmcr1:0X0000000002FEF6F0 mmcra:0X00000000 > -event:0X0051 mmcr0:0X00000000 mmcr1:0X0000000002FEF6F0 mmcra:0X00000000 > -event:0X0052 mmcr0:0X00000000 mmcr1:0X0000000002FEF6F0 mmcra:0X00000000 > -event:0X0053 mmcr0:0X00000000 mmcr1:0X0000000002FEF6F0 mmcra:0X00000000 > - > -#Group 6 pm_compat_instruction_directory, Instruction Directory > -event:0X0060 mmcr0:0X00000000 mmcr1:0X00000000F6FC02FC mmcra:0X00000000 > -event:0X0061 mmcr0:0X00000000 mmcr1:0X00000000F6FC02FC mmcra:0X00000000 > -event:0X0062 mmcr0:0X00000000 mmcr1:0X00000000F6FC02FC mmcra:0X00000000 > -event:0X0063 mmcr0:0X00000000 mmcr1:0X00000000F6FC02FC mmcra:0X00000000 > - > -#Group 7 pm_compat_data_directory, Data Directory > -event:0X0070 mmcr0:0X00000000 mmcr1:0X00000000FCF6FCFA mmcra:0X00000000 > -event:0X0071 mmcr0:0X00000000 mmcr1:0X00000000FCF6FCFA mmcra:0X00000000 > -event:0X0072 mmcr0:0X00000000 mmcr1:0X00000000FCF6FCFA mmcra:0X00000000 > -event:0X0073 mmcr0:0X00000000 mmcr1:0X00000000FCF6FCFA mmcra:0X00000000 > - > -#Group 8 pm_compat_cpi_1plus_ppc, Misc CPI and utilization data > -event:0X0080 mmcr0:0X00000000 mmcr1:0X00000000F2F4F2F2 mmcra:0X00000000 > -event:0X0081 mmcr0:0X00000000 mmcr1:0X00000000F2F4F2F2 mmcra:0X00000000 > -event:0X0082 mmcr0:0X00000000 mmcr1:0X00000000F2F4F2F2 mmcra:0X00000000 > -event:0X0083 mmcr0:0X00000000 mmcr1:0X00000000F2F4F2F2 mmcra:0X00000000 > - > -#Group 9 pm_compat_misc_events1, Misc Events > -event:0X0090 mmcr0:0X00000000 mmcr1:0X0000000002F8F81E mmcra:0X00000000 > -event:0X0091 mmcr0:0X00000000 mmcr1:0X0000000002F8F81E mmcra:0X00000000 > -event:0X0092 mmcr0:0X00000000 mmcr1:0X0000000002F8F81E mmcra:0X00000000 > -event:0X0093 mmcr0:0X00000000 mmcr1:0X0000000002F8F81E mmcra:0X00000000 > - > -#Group 10 pm_compat_misc_events2, Misc Events > -event:0X00A0 mmcr0:0X00000000 mmcr1:0X00000000F0F2F4F8 mmcra:0X00000000 > -event:0X00A1 mmcr0:0X00000000 mmcr1:0X00000000F0F2F4F8 mmcra:0X00000000 > -event:0X00A2 mmcr0:0X00000000 mmcr1:0X00000000F0F2F4F8 mmcra:0X00000000 > -event:0X00A3 mmcr0:0X00000000 mmcr1:0X00000000F0F2F4F8 mmcra:0X00000000 > - > -#Group 11 pm_compat_misc_events3, Misc Events > -event:0X00B0 mmcr0:0X00000000 mmcr1:0X00000000F8F2F8F6 mmcra:0X00000000 > -event:0X00B1 mmcr0:0X00000000 mmcr1:0X00000000F8F2F8F6 mmcra:0X00000000 > -event:0X00B2 mmcr0:0X00000000 mmcr1:0X00000000F8F2F8F6 mmcra:0X00000000 > -event:0X00B3 mmcr0:0X00000000 mmcr1:0X00000000F8F2F8F6 mmcra:0X00000000 > - > -#Group 12 pm_compat_suspend, Suspend Events > -event:0X00C0 mmcr0:0X00000000 mmcr1:0X0000000000000000 mmcra:0X00000000 > -event:0X00C1 mmcr0:0X00000000 mmcr1:0X0000000000000000 mmcra:0X00000000 > -event:0X00C2 mmcr0:0X00000000 mmcr1:0X0000000000000000 mmcra:0X00000000 > -event:0X00C3 mmcr0:0X00000000 mmcr1:0X0000000000000000 mmcra:0X00000000 > diff --git a/events/ppc64/ibm-compat-v1/events b/events/ppc64/ibm-compat-v1/events > deleted file mode 100644 > index 9d5e9c6..0000000 > --- a/events/ppc64/ibm-compat-v1/events > +++ /dev/null > @@ -1,91 +0,0 @@ > -#PPC64 pmu-compat events, version 1 > -# > -# Copyright OProfile authors > -# Copyright (c) International Business Machines, 2009. > -# Contributed by Maynard Johnson <[email protected]>. > -# > -# > -# Within each group, the event names must be unique. Each event in a group is > -# assigned to a unique counter. > -# > -# Only events within the same group can be selected simultaneously. > -# Each event is given a unique event number. The event number is used by the > -# OProfile code to resolve event names for the post-processing. This is done > -# to preserve compatibility with the rest of the OProfile code. The event > -# numbers are formatted as follows: <group_num>concat(<counter for the event>). > - > -#Group Default > -event:0X001 counters:2 um:zero minimum:10000 name:CYCLES : Processor Cycles > - > - > -#Group 1 pm_compat_utilization1, Basic CPU utilization > -event:0X0010 counters:0 um:zero minimum:1000 name:PM_THRD_ONE_RUN_CYC_GRP1 : (Group 1 pm_compat_utilization1) At least one thread in run cycles > -event:0X0011 counters:1 um:zero minimum:10000 name:PM_RUN_CYC_GRP1 : (Group 1 pm_compat_utilization1) Run cycles > -event:0X0012 counters:2 um:zero minimum:10000 name:PM_CYC_GRP1 : (Group 1 pm_compat_utilization1) Processor cycles > -event:0X0013 counters:3 um:zero minimum:1000 name:PM_RUN_PURR_GRP1 : (Group 1 pm_compat_utilization1) Run PURR Even > - > -#Group 2 pm_compat_utilization2, CPI and utilization data > -event:0X0020 counters:0 um:zero minimum:1000 name:PM_FPU_FLOP_GRP2 : (Group 2 pm_compat_utilization2) FPU executed 1FLOP, FMA, FSQRT or FDIV instruction > -event:0X0021 counters:1 um:zero minimum:10000 name:PM_RUN_CYC_GRP2 : (Group 2 pm_compat_utilization2) Run cycles > -event:0X0022 counters:2 um:zero minimum:10000 name:PM_CYC_GRP2 : (Group 2 pm_compat_utilization2) Processor cycles > -event:0X0023 counters:3 um:zero minimum:1000 name:PM_RUN_INST_CMPL_GRP2 : (Group 2 pm_compat_utilization2) Run instructions completed > - > -#Group 3 pm_compat_dsource, Data Access sources > -event:0X0030 counters:0 um:zero minimum:1000 name:PM_DATA_FROM_L1-5_GRP3 : (Group 3 pm_compat_dsource) Data loaded from L1.5 > -event:0X0031 counters:1 um:zero minimum:1000 name:PM_DATA_FROM_L2MISS_GRP3 : (Group 3 pm_compat_dsource) Data loaded missed L2 > -event:0X0032 counters:2 um:zero minimum:1000 name:PM_DATA_FROM_L3MISS_GRP3 : (Group 3 pm_compat_dsource) Data loaded from private L3 miss > -event:0X0033 counters:3 um:zero minimum:1000 name:PM_RUN_INST_CMPL_GRP3 : (Group 3 pm_compat_dsource) Run instructions completed > - > -#Group 4 pm_compat_l1_dcache_load_store_miss, L1 D-Cache load/store miss > -event:0X0040 counters:0 um:zero minimum:10000 name:PM_INST_CMPL_GRP4 : (Group 4 pm_compat_l1_dcache_load_store_miss) Instruction completed > -event:0X0041 counters:1 um:zero minimum:1000 name:PM_ST_FIN_GRP4 : (Group 4 pm_compat_l1_dcache_load_store_miss) Store instructions finished > -event:0X0042 counters:2 um:zero minimum:1000 name:PM_ST_MISS_L1_GRP4 : (Group 4 pm_compat_l1_dcache_load_store_miss) L1 D cache store misses > -event:0X0043 counters:3 um:zero minimum:1000 name:PM_LD_MISS_L1_GRP4 : (Group 4 pm_compat_l1_dcache_load_store_miss) L1 D cache load misses > - > -#Group 5 pm_compat_l1_cache_load, L1 Cache loads > -event:0X0050 counters:0 um:zero minimum:10000 name:PM_INST_CMPL_GRP5 : (Group 5 pm_compat_l1_cache_load) Instruction completed > -event:0X0051 counters:1 um:zero minimum:1000 name:PM_DATA_FROM_L2MISS_GRP5 : (Group 5 pm_compat_l1_cache_load) Data loaded missed L2 > -event:0X0052 counters:2 um:zero minimum:1000 name:PM_L1_DCACHE_RELOAD_VALID_GRP5 : (Group 5 pm_compat_l1_cache_load) L1 reload data source valid > -event:0X0053 counters:3 um:zero minimum:1000 name:PM_LD_MISS_L1_GRP5 : (Group 5 pm_compat_l1_cache_load) L1 D cache load misses > - > -#Group 6 pm_compat_instruction_directory, Instruction Directory > -event:0X0060 counters:0 um:zero minimum:1000 name:PM_IERAT_MISS_GRP6 : (Group 6 pm_compat_instruction_directory) IERAT miss coun > -event:0X0061 counters:1 um:zero minimum:1000 name:PM_L1_ICACHE_MISS_GRP6 : (Group 6 pm_compat_instruction_directory) L1 I cache miss coun > -event:0X0062 counters:2 um:zero minimum:10000 name:PM_INST_CMPL_GRP6 : (Group 6 pm_compat_instruction_directory) Instruction completed > -event:0X0063 counters:3 um:zero minimum:1000 name:PM_ITLB_MISS_GRP6 : (Group 6 pm_compat_instruction_directory) Instruction TLB misses > - > -#Group 7 pm_compat_data_directory, Data Directory > -event:0X0070 counters:0 um:zero minimum:1000 name:PM_LSU_DERAT_MISS_CYC_GRP7 : (Group 7 pm_compat_data_directory) DERAT miss latency > -event:0X0071 counters:1 um:zero minimum:1000 name:PM_LSU_DERAT_MISS_GRP7 : (Group 7 pm_compat_data_directory) DERAT misses > -event:0X0072 counters:2 um:zero minimum:1000 name:PM_DTLB_MISS_GRP7 : (Group 7 pm_compat_data_directory) Data TLB misses > -event:0X0073 counters:3 um:zero minimum:1000 name:PM_RUN_INST_CMPL_GRP7 : (Group 7 pm_compat_data_directory) Run instructions completed > - > -#Group 8 pm_compat_cpi_1plus_ppc, Misc CPI and utilization data > -event:0X0080 counters:0 um:zero minimum:1000 name:PM_1PLUS_PPC_CMPL_GRP8 : (Group 8 pm_compat_cpi_1plus_ppc) One or more PPC instruction completed > -event:0X0081 counters:1 um:zero minimum:10000 name:PM_RUN_CYC_GRP8 : (Group 8 pm_compat_cpi_1plus_ppc) Run cycles > -event:0X0082 counters:2 um:zero minimum:1000 name:PM_INST_DISP_GRP8 : (Group 8 pm_compat_cpi_1plus_ppc) Instructions dispatched > -event:0X0083 counters:3 um:zero minimum:1000 name:PM_1PLUS_PPC_DISP_GRP8 : (Group 8 pm_compat_cpi_1plus_ppc) Cycles at least one instruction dispatched > - > -#Group 9 pm_compat_misc_events1, Misc Events > -event:0X0090 counters:0 um:zero minimum:10000 name:PM_INST_CMPL_GRP9 : (Group 9 pm_compat_misc_events1) Instruction completed > -event:0X0091 counters:1 um:zero minimum:1000 name:PM_EXT_INT_GRP9 : (Group 9 pm_compat_misc_events1) External interrupts > -event:0X0092 counters:2 um:zero minimum:1000 name:PM_TB_BIT_TRANS_GRP9 : (Group 9 pm_compat_misc_events1) Time Base bit transition > -event:0X0093 counters:3 um:zero minimum:10000 name:PM_CYC_GRP9 : (Group 9 pm_compat_misc_events1) Processor cycles > - > -#Group 10 pm_compat_misc_events2, Misc Events > -event:0X00A0 counters:0 um:zero minimum:1000 name:PM_INST_IMC_MATCH_CMPL_GRP10 : (Group 10 pm_compat_misc_events2) IMC matched instructions completed > -event:0X00A1 counters:1 um:zero minimum:1000 name:PM_INST_DISP_GRP10 : (Group 10 pm_compat_misc_events2) Instructions dispatched > -event:0X00A2 counters:2 um:zero minimum:1000 name:PM_THRD_CONC_RUN_INST_GRP10 : (Group 10 pm_compat_misc_events2) Concurrent run instructions > -event:0X00A3 counters:3 um:zero minimum:1000 name:PM_FLUSH_GRP10 : (Group 10 pm_compat_misc_events2) Flushes > - > -#Group 11 pm_compat_misc_events3, Misc Events > -event:0X00B0 counters:0 um:zero minimum:1000 name:PM_GCT_EMPTY_CYC_GRP11 : (Group 11 pm_compat_misc_events3) Cycles GCT empty > -event:0X00B1 counters:1 um:zero minimum:1000 name:PM_INST_DISP_GRP11 : (Group 11 pm_compat_misc_events3) Instructions dispatched > -event:0X00B2 counters:2 um:zero minimum:1000 name:PM_TB_BIT_TRANS_GRP11 : (Group 11 pm_compat_misc_events3) Time Base bit transition > -event:0X00B3 counters:3 um:zero minimum:1000 name:PM_BR_MPRED_GRP11 : (Group 11 pm_compat_misc_events3) Branches incorrectly predicted > - > -#Group 12 pm_compat_suspend, Suspend Events > -event:0X00C0 counters:0 um:zero minimum:1000 name:PM_SUSPENDED_GRP12 : (Group 12 pm_compat_suspend) Suspended > -event:0X00C1 counters:1 um:zero minimum:1000 name:PM_SUSPENDED_GRP12 : (Group 12 pm_compat_suspend) Suspended > -event:0X00C2 counters:2 um:zero minimum:1000 name:PM_SUSPENDED_GRP12 : (Group 12 pm_compat_suspend) Suspended > -event:0X00C3 counters:3 um:zero minimum:1000 name:PM_SUSPENDED_GRP12 : (Group 12 pm_compat_suspend) Suspended > diff --git a/events/ppc64/ibm-compat-v1/unit_masks b/events/ppc64/ibm-compat-v1/unit_masks > deleted file mode 100644 > index 170c53b..0000000 > --- a/events/ppc64/ibm-compat-v1/unit_masks > +++ /dev/null > @@ -1,9 +0,0 @@ > -# > -# Copyright OProfile authors > -# Copyright (c) International Business Machines, 2009. > -# Contributed by Maynard Johnson <[email protected]>. > -# > -# ppc64 compat mode version 1 possible unit masks > -# > -name:zero type:mandatory default:0x0 > - 0x0 No unit mask > diff --git a/events/ppc64/pa6t/event_mappings b/events/ppc64/pa6t/event_mappings > deleted file mode 100644 > index 0bbddcb..0000000 > --- a/events/ppc64/pa6t/event_mappings > +++ /dev/null > @@ -1,48 +0,0 @@ > -# pa6t does not have an mmcra. mmcr0 has all the enables and config > -# bits. mmcr1 contains the event selectors for the four programmable > -# events > - > -# Group Default > -event:0x1 mmcr0:0x000000000005b81b mmcr1:0x0000000000949f00 mmcra:0x0 > -event:0x3 mmcr0:0x000000000005b81b mmcr1:0x0000000000949f00 mmcra:0x0 > -event:0x4 mmcr0:0x000000000005b81b mmcr1:0x0000000000949f00 mmcra:0x0 > - > -# Group 1, Load/Store > -event:0x10 mmcr0:0x000000000007f83f mmcr1:0x00000000a8c0cab1 mmcra:0x0 > -event:0x11 mmcr0:0x000000000007f83f mmcr1:0x00000000a8c0cab1 mmcra:0x0 > -event:0x12 mmcr0:0x000000000007f83f mmcr1:0x00000000a8c0cab1 mmcra:0x0 > -event:0x13 mmcr0:0x000000000007f83f mmcr1:0x00000000a8c0cab1 mmcra:0x0 > -event:0x14 mmcr0:0x000000000007f83f mmcr1:0x00000000a8c0cab1 mmcra:0x0 > -event:0x15 mmcr0:0x000000000007f83f mmcr1:0x00000000a8c0cab1 mmcra:0x0 > - > -# Group 2, Frontend > -event:0x20 mmcr0:0x000000000007f83f mmcr1:0x0000000002058401 mmcra:0x0 > -event:0x21 mmcr0:0x000000000007f83f mmcr1:0x0000000002058401 mmcra:0x0 > -event:0x22 mmcr0:0x000000000007f83f mmcr1:0x0000000002058401 mmcra:0x0 > -event:0x23 mmcr0:0x000000000007f83f mmcr1:0x0000000002058401 mmcra:0x0 > -event:0x24 mmcr0:0x000000000007f83f mmcr1:0x0000000002058401 mmcra:0x0 > -event:0x25 mmcr0:0x000000000007f83f mmcr1:0x0000000002058401 mmcra:0x0 > - > -# Group 3, Branches > -event:0x30 mmcr0:0x000000000007f83f mmcr1:0x000000008d8b8988 mmcra:0x0 > -event:0x31 mmcr0:0x000000000007f83f mmcr1:0x000000008d8b8988 mmcra:0x0 > -event:0x32 mmcr0:0x000000000007f83f mmcr1:0x000000008d8b8988 mmcra:0x0 > -event:0x33 mmcr0:0x000000000007f83f mmcr1:0x000000008d8b8988 mmcra:0x0 > -event:0x34 mmcr0:0x000000000007f83f mmcr1:0x000000008d8b8988 mmcra:0x0 > -event:0x35 mmcr0:0x000000000007f83f mmcr1:0x000000008d8b8988 mmcra:0x0 > - > -# Group 4, Translation > -event:0x40 mmcr0:0x000000000007f83f mmcr1:0x0000000086baa7a8 mmcra:0x0 > -event:0x41 mmcr0:0x000000000007f83f mmcr1:0x0000000086baa7a8 mmcra:0x0 > -event:0x42 mmcr0:0x000000000007f83f mmcr1:0x0000000086baa7a8 mmcra:0x0 > -event:0x43 mmcr0:0x000000000007f83f mmcr1:0x0000000086baa7a8 mmcra:0x0 > -event:0x44 mmcr0:0x000000000007f83f mmcr1:0x0000000086baa7a8 mmcra:0x0 > -event:0x45 mmcr0:0x000000000007f83f mmcr1:0x0000000086baa7a8 mmcra:0x0 > - > -# Group 5, Memory > -event:0x50 mmcr0:0x000000000007f83f mmcr1:0x00000000c030cab1 mmcra:0x0 > -event:0x51 mmcr0:0x000000000007f83f mmcr1:0x00000000c030cab1 mmcra:0x0 > -event:0x52 mmcr0:0x000000000007f83f mmcr1:0x00000000c030cab1 mmcra:0x0 > -event:0x53 mmcr0:0x000000000007f83f mmcr1:0x00000000c030cab1 mmcra:0x0 > -event:0x54 mmcr0:0x000000000007f83f mmcr1:0x00000000c030cab1 mmcra:0x0 > -event:0x55 mmcr0:0x000000000007f83f mmcr1:0x00000000c030cab1 mmcra:0x0 > diff --git a/events/ppc64/pa6t/events b/events/ppc64/pa6t/events > deleted file mode 100644 > index 5e2bc2f..0000000 > --- a/events/ppc64/pa6t/events > +++ /dev/null > @@ -1,52 +0,0 @@ > -# ppc64 pa6t events > -# > -# Unlike the IBM ppc64 chips, any of pa6t's events can be programmed into any > -# of the counters (pmc2-5). The notion of groups on pa6t is thus > -# artificial. That said, we can still define useful aggregations to guide the > -# user in his choice of group for a profiling session. > - > -# Group Default > -event:0x1 counters:0 um:zero minimum:10000 name:CYCLES : Processor Cycles > -event:0x3 counters:3 um:zero minimum:10000 name:ISS_CYCLES : Processor Cycles with instructions issued > -event:0x4 counters:4 um:zero minimum:10000 name:RET_UOP : Retired Micro-operatioins > - > -# Group 1, Load/Store > -event:0x10 counters:0 um:zero minimum:10000 name:GRP1_CYCLES : Processor Cycles > -event:0x11 counters:1 um:zero minimum:10000 name:GRP1_INST_RETIRED : Instructions retired > -event:0x12 counters:2 um:zero minimum:1000 name:GRP1_DCACHE_RD_MISS__NS : Dcache read misses NS > -event:0x13 counters:3 um:zero minimum:500 name:GRP1_MRB_LD_MISS_L2__NS : Load misses filling from memory > -event:0x14 counters:4 um:zero minimum:500 name:GRP1_MRB_ST_MISS_ALLOC__NS : Store misses in L1D and allocates an MRB entry > -event:0x15 counters:5 um:zero minimum:500 name:GRP1_TLB_MISS_D__NS : TLB misses NS (D- only) > - > -# Group 2, Frontend > -event:0x20 counters:0 um:zero minimum:10000 name:GRP2_CYCLES : Processor Cycles > -event:0x21 counters:1 um:zero minimum:10000 name:GRP2_INST_RETIRED : Instructions retired > -event:0x22 counters:2 um:zero minimum:2000 name:GRP2_FETCH_REQ : Demand fetch requests made to the Icache > -event:0x23 counters:3 um:zero minimum:500 name:GRP2_ICACHE_MISS_DEM__NS : Demand fetch requests missing in the Icache > -event:0x24 counters:4 um:zero minimum:500 name:GRP2_ICACHE_MISS_ALL : Demand and spec fetch requests missing in the Icache > -event:0x25 counters:5 um:zero minimum:2000 name:GRP2_ICACHE_ACC : Icache accesses > - > -# Group 3, Branches > -event:0x30 counters:0 um:zero minimum:10000 name:GRP3_CYCLES : Processor Cycles > -event:0x31 counters:1 um:zero minimum:10000 name:GRP3_INST_RETIRED : Instructions retired > -event:0x32 counters:2 um:zero minimum:500 name:GRP3_NXT_LINE_MISPRED__NS : Next fetch address mispredict > -event:0x33 counters:3 um:zero minimum:500 name:GRP3_DIRN_MISPRED__NS : Branch direction mispredict > -event:0x34 counters:4 um:zero minimum:500 name:GRP3_TGT_ADDR_MISPRED__NS : Branch target address mispredict > -event:0x35 counters:5 um:zero minimum:2000 name:GRP3_BRA_TAKEN__NS : Taken branches > - > -# Group 4, Translation > -event:0x40 counters:0 um:zero minimum:10000 name:GRP4_CYCLES : Processor Cycles > -event:0x41 counters:1 um:zero minimum:10000 name:GRP4_INST_RETIRED : Instructions retired > -event:0x42 counters:2 um:zero minimum:500 name:GRP4_TLB_MISS_D__NS : TLB Misses (D-) > -event:0x43 counters:3 um:zero minimum:500 name:GRP4_TLB_MISS_I__NS : TLB MIsses (I-) > -event:0x44 counters:4 um:zero minimum:500 name:GRP4_DERAT_MISS__NS : DERAT Misses > -event:0x45 counters:5 um:zero minimum:500 name:GRP4_IERAT_MISS__NS : IERAT Misses > - > -# Group 5, Memory > -event:0x50 counters:0 um:zero minimum:10000 name:GRP5_CYCLES : Processor Cycles > -event:0x51 counters:1 um:zero minimum:10000 name:GRP5_INST_RETIRED : Instructions retired > -event:0x52 counters:2 um:zero minimum:500 name:GRP5_DCACHE_RD_MISS__NS : Dcache read misses NS > -event:0x53 counters:3 um:zero minimum:500 name:GRP5_MRB_LD_MISS_L2__NS : Load misses filling from memory > -event:0x54 counters:4 um:zero minimum:500 name:GRP5_DCACHE_VIC : Dcache line evicted (snoops not included) > -event:0x55 counters:5 um:zero minimum:500 name:GRP5_MRB_ST_MISS_ALLOC__NS : Store misses in L1D and allocates an MRB entry > - > diff --git a/events/ppc64/pa6t/unit_masks b/events/ppc64/pa6t/unit_masks > deleted file mode 100644 > index ccc3ddd..0000000 > --- a/events/ppc64/pa6t/unit_masks > +++ /dev/null > @@ -1,4 +0,0 @@ > -# ppc64 pa6t possible unit masks > -# > -name:zero type:mandatory default:0x0 > - 0x0 No unit mask > diff --git a/events/rtc/events b/events/rtc/events > deleted file mode 100644 > index cce44b0..0000000 > --- a/events/rtc/events > +++ /dev/null > @@ -1,3 +0,0 @@ > -# RTC events > -# > -name:RTC_INTERRUPTS event:0xff counters:0 um:zero minimum:2 : RTC interrupts/sec (rounded up to power of two) > diff --git a/events/rtc/unit_masks b/events/rtc/unit_masks > deleted file mode 100644 > index 6984b62..0000000 > --- a/events/rtc/unit_masks > +++ /dev/null > @@ -1,4 +0,0 @@ > -# RTC possible unit masks > -# > -name:zero type:mandatory default:0x0 > - 0x0 No unit mask > diff --git a/gui/.gitignore b/gui/.gitignore > deleted file mode 100644 > index 6432d1c..0000000 > --- a/gui/.gitignore > +++ /dev/null > @@ -1,7 +0,0 @@ > -.buildui > -.deps > -.libs > -oprof_start > -oprof_start.moc.cpp > -Makefile > -Makefile.in > diff --git a/gui/Makefile.am b/gui/Makefile.am > deleted file mode 100644 > index c079e9b..0000000 > --- a/gui/Makefile.am > +++ /dev/null > @@ -1,43 +0,0 @@ > -SUBDIRS = ui > - > -dist_sources = \ > - oprof_start.cpp \ > - oprof_start_config.cpp \ > - oprof_start_util.cpp \ > - oprof_start_main.cpp \ > - oprof_start.h \ > - oprof_start_config.h \ > - oprof_start_util.h > - > -EXTRA_DIST = $(dist_sources) > - > -if have_qt > - > -AM_CPPFLAGS = \ > - @QT_CFLAGS@ \ > - -I ${top_srcdir}/libop \ > - -I ${top_srcdir}/libutil++ \ > - -I ${top_srcdir}/libutil \ > - @OP_CPPFLAGS@ > - > -AM_CXXFLAGS = @OP_CXXFLAGS@ > - > -bin_PROGRAMS = oprof_start > - > -oprof_start_SOURCES = $(dist_sources) > -nodist_oprof_start_SOURCES = oprof_start.moc.cpp > -oprof_start_LDADD = \ > - ../libutil++/libutil++.a \ > - ../libop/libop.a \ > - ../libutil/libutil.a \ > - ui/liboprof_start.a \ > - @QT_LIBS@ \ > - @X_LIBS@ > - > -oprof_start.moc.cpp: ${top_srcdir}/gui/oprof_start.h > - $(MOC) -o $@ ${top_srcdir}/gui/oprof_start.h > - > -clean-local: > - rm -f oprof_start.moc.cpp > - > -endif > diff --git a/gui/oprof_start.cpp b/gui/oprof_start.cpp > deleted file mode 100644 > index f1d9971..0000000 > --- a/gui/oprof_start.cpp > +++ /dev/null > @@ -1,1094 +0,0 @@ > -/** > - * @file oprof_start.cpp > - * The GUI start main class > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Philippe Elie > - * @author John Levon > - */ > - > -#include <sys/stat.h> > -#include <unistd.h> > - > -#include <ctime> > -#include <cstdio> > -#include <cmath> > -#include <sstream> > -#include <iostream> > -#include <fstream> > -#include <algorithm> > - > -#if QT3_SUPPORT > -#include <Qt/qlineedit.h> > -#include <Qt/qcheckbox.h> > -#include <Qt/qtabwidget.h> > -#include <Qt/qmessagebox.h> > -#include <Qt/qvalidator.h> > -#include <Qt/qlabel.h> > -#include <Qt/qpushbutton.h> > -#include <Qt/q3listview.h> > -#include <Qt/q3combobox.h> > -#include <Qt/q3listbox.h> > -#include <Qt/q3filedialog.h> > -#include <Qt/q3buttongroup.h> > -#include <Qt/q3header.h> > -#else > -#include <qlineedit.h> > -#include <qcheckbox.h> > -#include <qtabwidget.h> > -#include <qmessagebox.h> > -#include <qvalidator.h> > -#include <qlabel.h> > -#include <qpushbutton.h> > -#include <qlistview.h> > -#include <qcombobox.h> > -#include <qlistbox.h> > -#include <qfiledialog.h> > -#include <qbuttongroup.h> > -#include <qheader.h> > -#define Q3ListView QListView > -#endif > - > -#include "oprof_start.h" > -#include "op_config.h" > -#include "string_manip.h" > -#include "op_cpufreq.h" > -#include "op_alloc_counter.h" > -#include "oprof_start_util.h" > -#include "file_manip.h" > - > -#include "op_hw_config.h" > - > -using namespace std; > - > -static char const * green_xpm[] = { > -"16 16 2 1", > -" c None", > -". c #00FF00", > -" ....... ", > -" ........... ", > -" ............. ", > -" ............. ", > -"............... ", > -"............... ", > -"............... ", > -"............... ", > -"............... ", > -"............... ", > -"............... ", > -" ............. ", > -" ............. ", > -" ........... ", > -" ....... ", > -" " }; > - > -static char const * red_xpm[] = { > -"16 16 2 1", > -" c None", > -". c #FF0000", > -" ....... ", > -" ........... ", > -" ............. ", > -" ............. ", > -"............... ", > -"............... ", > -"............... ", > -"............... ", > -"............... ", > -"............... ", > -"............... ", > -" ............. ", > -" ............. ", > -" ........... ", > -" ....... ", > -" " }; > - > -static QPixmap * green_pixmap; > -static QPixmap * red_pixmap; > -static op_event_descr null_evt; > - > - > - > -op_event_descr::op_event_descr() > - : > - counter_mask(0), > - val(0), > - unit(0), > - min_count(0) > -{ > -} > - > - > -oprof_start::oprof_start() > - : > - oprof_start_base(0, 0, false, 0), > - event_count_validator(new QIntValidator(event_count_edit)), > - current_event(0), > - cpu_speed(op_cpu_frequency()), > - total_nr_interrupts(0) > -{ > - green_pixmap = new QPixmap(green_xpm); > - red_pixmap = new QPixmap(red_xpm); > - vector<string> args; > - args.push_back("--init"); > - > - if (do_exec_command(OP_BINDIR "/opcontrol", args)) > - exit(EXIT_FAILURE); > - > - cpu_type = op_get_cpu_type(); > - op_nr_counters = op_get_nr_counters(cpu_type); > - > - if (cpu_type == CPU_TIMER_INT) { > - setup_config_tab->removePage(counter_setup_page); > - } else { > - fill_events(); > - } > - > - op_interface interface = op_get_interface(); > - if (interface == OP_INTERFACE_NO_GOOD) { > - QMessageBox::warning(this, 0, "Couldn't determine kernel" > - " interface version"); > - exit(EXIT_FAILURE); > - } > - bool is_26 = interface == OP_INTERFACE_26; > - > - if (is_26) { > - note_table_size_edit->hide(); > - note_table_size_label->hide(); > - if (!op_file_readable("/dev/oprofile/backtrace_depth")) { > - callgraph_depth_label->hide(); > - callgraph_depth_edit->hide(); > - } > - } else { > - callgraph_depth_label->hide(); > - callgraph_depth_edit->hide(); > - buffer_watershed_label->hide(); > - buffer_watershed_edit->hide(); > - cpu_buffer_size_label->hide(); > - cpu_buffer_size_edit->hide(); > - } > - > - // setup the configuration page. > - kernel_filename_edit->setText(config.kernel_filename.c_str()); > - > - no_vmlinux->setChecked(config.no_kernel); > - > - buffer_size_edit->setText(QString().setNum(config.buffer_size)); > - buffer_watershed_edit->setText(QString().setNum(config.buffer_watershed)); > - cpu_buffer_size_edit->setText(QString().setNum(config.cpu_buffer_size)); > - note_table_size_edit->setText(QString().setNum(config.note_table_size)); > - callgraph_depth_edit->setText(QString().setNum(config.callgraph_depth)); > - verbose->setChecked(config.verbose); > - separate_lib_cb->setChecked(config.separate_lib); > - separate_kernel_cb->setChecked(config.separate_kernel); > - separate_cpu_cb->setChecked(config.separate_cpu); > - separate_thread_cb->setChecked(config.separate_thread); > - > - // the unit mask check boxes > - hide_masks(); > - > - event_count_edit->setValidator(event_count_validator); > - QIntValidator * iv; > - iv = new QIntValidator(OP_MIN_BUF_SIZE, OP_MAX_BUF_SIZE, buffer_size_edit); > - buffer_size_edit->setValidator(iv); > - note_table_size_edit->setValidator(iv); > - iv = new QIntValidator(0, INT_MAX, callgraph_depth_edit); > - callgraph_depth_edit->setValidator(iv); > - iv = new QIntValidator(0, INT_MAX, buffer_watershed_edit); > - buffer_watershed_edit->setValidator(iv); > - iv = new QIntValidator(0, OP_MAX_CPU_BUF_SIZE, cpu_buffer_size_edit); > - cpu_buffer_size_edit->setValidator(iv); > - > - // daemon status timer > - startTimer(5000); > - timerEvent(0); > - > - resize(minimumSizeHint()); > - > - // force the pixmap re-draw > - event_selected(); > -} > - > - > -void oprof_start::fill_events() > -{ > - // we need to build the event descr stuff before loading the > - // configuration because we use locate_event to get an event descr > - // from its name. > - struct list_head * pos; > - struct list_head * events = op_events(cpu_type); > - > - list_for_each(pos, events) { > - struct op_event * event = list_entry(pos, struct op_event, event_next); > - > - op_event_descr descr; > - > - descr.counter_mask = event->counter_mask; > - descr.val = event->val; > - if (event->unit->num) { > - descr.unit = event->unit; > - } else { > - descr.unit = 0; > - } > - > - descr.name = event->name; > - descr.help_str = event->desc; > - descr.min_count = event->min_count; > - > - for (uint ctr = 0; ctr < op_nr_counters; ++ctr) { > - uint count; > - > - if (!(descr.counter_mask & (1 << ctr))) > - continue; > - > - if (cpu_type == CPU_RTC) { > - count = 1024; > - } else { > - /* setting to cpu Hz / 2000 gives a safe value for > - * all events, and a good one for most. > - */ > - if (cpu_speed) > - count = int(cpu_speed * 500); > - else > - count = descr.min_count * 100; > - } > - > - event_cfgs[descr.name].count = count; > - event_cfgs[descr.name].umask = 0; > - if (descr.unit) > - event_cfgs[descr.name].umask = descr.unit->default_mask; > - event_cfgs[descr.name].os_ring_count = 1; > - event_cfgs[descr.name].user_ring_count = 1; > - } > - > - v_events.push_back(descr); > - } > - > - events_list->header()->hide(); > - events_list->setSorting(-1); > - > - fill_events_listbox(); > - > - read_set_events(); > - > - // FIXME: why this ? > - if (cpu_type == CPU_RTC) > - events_list->setCurrentItem(events_list->firstChild()); > - > - load_config_file(); > -} > - > - > -namespace { > - > -/// find the first item with the given text in column 0 or return NULL > -Q3ListViewItem * findItem(Q3ListView * view, char const * name) > -{ > - // Qt 2.3.1 does not have QListView::findItem() > - Q3ListViewItem * item = view->firstChild(); > - > - while (item && strcmp(item->text(0).latin1(), name)) > - item = item->nextSibling(); > - > - return item; > -} > - > -}; > - > - > -void oprof_start::setup_default_event() > -{ > - struct op_default_event_descr descr; > - op_default_event(cpu_type, &descr); > - > - event_cfgs[descr.name].umask = descr.um; > - event_cfgs[descr.name].count = descr.count; > - event_cfgs[descr.name].user_ring_count = 1; > - event_cfgs[descr.name].os_ring_count = 1; > - > - Q3ListViewItem * item = findItem(events_list, descr.name); > - if (item) > - item->setSelected(true); > -} > - > - > -void oprof_start::read_set_events() > -{ > - string name = get_config_filename(".oprofile/daemonrc"); > - > - ifstream in(name.c_str()); > - > - if (!in) { > - setup_default_event(); > - return; > - } > - > - string str; > - > - bool one_enabled = false; > - > - while (getline(in, str)) { > - string const val = split(str, '='); > - string const name = str; > - > - if (!is_prefix(name, "CHOSEN_EVENTS_")) > - continue; > - > - one_enabled = true; > - > - // CHOSEN_EVENTS_#nr=CPU_CLK_UNHALTED:10000:0:1:1 > - vector<string> parts = separate_token(val, ':'); > - > - if (parts.size() != 5 && parts.size() != 2) { > - cerr << "invalid configuration file\n"; > - // FIXME > - exit(EXIT_FAILURE); > - } > - > - string ev_name = parts[0]; > - event_cfgs[ev_name].count = > - op_lexical_cast<unsigned int>(parts[1]); > - > - // CPU_CLK_UNHALTED:10000 is also valid > - if (parts.size() == 5) { > - event_cfgs[ev_name].umask = > - op_lexical_cast<unsigned int>(parts[2]); > - event_cfgs[ev_name].user_ring_count = > - op_lexical_cast<unsigned int>(parts[3]); > - event_cfgs[ev_name].os_ring_count = > - op_lexical_cast<unsigned int>(parts[4]); > - } else { > - event_cfgs[ev_name].umask = 0; > - event_cfgs[ev_name].user_ring_count = 1; > - event_cfgs[ev_name].os_ring_count = 1; > - } > - > - Q3ListViewItem * item = findItem(events_list, ev_name.c_str()); > - if (item) > - item->setSelected(true); > - } > - > - // use default event if none set > - if (!one_enabled) > - setup_default_event(); > -} > - > - > -void oprof_start::load_config_file() > -{ > - string name = get_config_filename(".oprofile/daemonrc"); > - > - ifstream in(name.c_str()); > - if (!in) { > - if (!check_and_create_config_dir()) > - return; > - > - ofstream out(name.c_str()); > - if (!out) { > - QMessageBox::warning(this, 0, "Unable to open configuration " > - "file ~/.oprofile/daemonrc"); > - } > - return; > - } > - > - in >> config; > -} > - > - > -// user request a "normal" exit so save the config file. > -void oprof_start::accept() > -{ > - // record the previous settings > - record_selected_event_config(); > - > - save_config(); > - > - QDialog::accept(); > -} > - > - > -void oprof_start::closeEvent(QCloseEvent *) > -{ > - accept(); > -} > - > - > -void oprof_start::timerEvent(QTimerEvent *) > -{ > - static time_t last = time(0); > - > - daemon_status dstat; > - > - flush_profiler_data_btn->setEnabled(dstat.running); > - stop_profiler_btn->setEnabled(dstat.running); > - start_profiler_btn->setEnabled(!dstat.running); > - reset_sample_files_btn->setEnabled(!dstat.running); > - > - if (!dstat.running) { > - daemon_label->setText("Profiler is not running."); > - return; > - } > - > - ostringstream ss; > - ss << "Profiler running:"; > - > - time_t curr = time(0); > - total_nr_interrupts += dstat.nr_interrupts; > - > - if (curr - last) > - ss << " (" << dstat.nr_interrupts / (curr - last) << " interrupts / second, total " << total_nr_interrupts << ")"; > - > - daemon_label->setText(ss.str().c_str()); > - > - last = curr; > -} > - > - > -void oprof_start::fill_events_listbox() > -{ > - setUpdatesEnabled(false); > - > - for (vector<op_event_descr>::reverse_iterator cit = v_events.rbegin(); > - cit != v_events.rend(); ++cit) { > - new Q3ListViewItem(events_list, cit->name.c_str()); > - } > - > - setUpdatesEnabled(true); > - update(); > -} > - > - > -void oprof_start::display_event(op_event_descr const & descr) > -{ > - setUpdatesEnabled(false); > - > - setup_unit_masks(descr); > - os_ring_count_cb->setEnabled(true); > - user_ring_count_cb->setEnabled(true); > - event_count_edit->setEnabled(true); > - > - event_setting & cfg = event_cfgs[descr.name]; > - > - os_ring_count_cb->setChecked(cfg.os_ring_count); > - user_ring_count_cb->setChecked(cfg.user_ring_count); > - QString count_text; > - count_text.setNum(cfg.count); > - event_count_edit->setText(count_text); > - event_count_validator->setRange(descr.min_count, max_perf_count()); > - > - setUpdatesEnabled(true); > - update(); > -} > - > - > -bool oprof_start::is_selectable_event(Q3ListViewItem * item) > -{ > - if (item->isSelected()) > - return true; > - > - selected_events.insert(item); > - > - bool ret = false; > - if (alloc_selected_events()) > - ret = true; > - > - selected_events.erase(item); > - > - return ret; > -} > - > - > -void oprof_start::draw_event_list() > -{ > - Q3ListViewItem * cur; > - for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) { > - if (is_selectable_event(cur)) > - cur->setPixmap(0, *green_pixmap); > - else > - cur->setPixmap(0, *red_pixmap); > - } > -} > - > - > -bool oprof_start::alloc_selected_events() const > -{ > - vector<op_event const *> events; > - > - set<Q3ListViewItem *>::const_iterator it; > - for (it = selected_events.begin(); it != selected_events.end(); ++it) > - events.push_back(find_event_by_name((*it)->text(0).latin1(),0,0)); > - > - size_t * map = > - map_event_to_counter(&events[0], events.size(), cpu_type); > - > - if (!map) > - return false; > - > - free(map); > - return true; > -} > - > -void oprof_start::event_selected() > -{ > - // The deal is simple: QT lack of a way to know what item was the last > - // (de)selected item so we record a set of selected items and diff > - // it in the appropriate way with the previous list of selected items. > - > - set<Q3ListViewItem *> current_selection; > - Q3ListViewItem * cur; > - for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) { > - if (cur->isSelected()) > - current_selection.insert(cur); > - } > - > - // First remove the deselected item. > - vector<Q3ListViewItem *> new_deselected; > - set_difference(selected_events.begin(), selected_events.end(), > - current_selection.begin(), current_selection.end(), > - back_inserter(new_deselected)); > - vector<Q3ListViewItem *>::const_iterator it; > - for (it = new_deselected.begin(); it != new_deselected.end(); ++it) > - selected_events.erase(*it); > - > - // Now try to add the newly selected item if enough HW resource exists > - vector<Q3ListViewItem *> new_selected; > - set_difference(current_selection.begin(), current_selection.end(), > - selected_events.begin(), selected_events.end(), > - back_inserter(new_selected)); > - for (it = new_selected.begin(); it != new_selected.end(); ++it) { > - selected_events.insert(*it); > - if (!alloc_selected_events()) { > - (*it)->setSelected(false); > - selected_events.erase(*it); > - } else { > - current_event = *it; > - } > - } > - > - draw_event_list(); > - > - if (current_event) > - display_event(locate_event(current_event->text(0).latin1())); > -} > - > - > -void oprof_start::event_over(Q3ListViewItem * item) > -{ > - op_event_descr const & descr = locate_event(item->text(0).latin1()); > - > - string help_str = descr.help_str.c_str(); > - if (!is_selectable_event(item)) { > - help_str += " conflicts with:"; > - > - set<Q3ListViewItem *>::const_iterator it; > - for (it = selected_events.begin(); > - it != selected_events.end(); ) { > - Q3ListViewItem * temp = *it; > - selected_events.erase(it++); > - if (is_selectable_event(item)) { > - help_str += " "; > - help_str += temp->text(0).latin1(); > - } > - selected_events.insert(temp); > - } > - } > - > - event_help_label->setText(help_str.c_str()); > -} > - > - > -/// select the kernel image filename > -void oprof_start::choose_kernel_filename() > -{ > - string name = kernel_filename_edit->text().latin1(); > - string result = do_open_file_or_dir(name, false); > - > - if (!result.empty()) > - kernel_filename_edit->setText(result.c_str()); > -} > - > - > -// this record the current selected event setting in the event_cfg[] stuff. > -// FIXME: need validation? > -void oprof_start::record_selected_event_config() > -{ > - if (!current_event) > - return; > - > - string name(current_event->text(0).latin1()); > - > - event_setting & cfg = event_cfgs[name]; > - op_event_descr const & curr = locate_event(name); > - > - cfg.count = event_count_edit->text().toUInt(); > - cfg.os_ring_count = os_ring_count_cb->isChecked(); > - cfg.user_ring_count = user_ring_count_cb->isChecked(); > - cfg.umask = get_unit_mask(curr); > -} > - > - > -// validate and save the configuration (The qt validator installed > -// are not sufficient to do the validation) > -bool oprof_start::record_config() > -{ > - config.kernel_filename = kernel_filename_edit->text().latin1(); > - config.no_kernel = no_vmlinux->isChecked(); > - > - uint temp = buffer_size_edit->text().toUInt(); > - if (temp < OP_MIN_BUF_SIZE || temp > OP_MAX_BUF_SIZE) { > - ostringstream error; > - > - error << "buffer size out of range: " << temp > - << " valid range is [" << OP_MIN_BUF_SIZE << ", " > - << OP_MAX_BUF_SIZE << "]"; > - > - QMessageBox::warning(this, 0, error.str().c_str()); > - > - return false; > - } > - config.buffer_size = temp; > - > - temp = buffer_watershed_edit->text().toUInt(); > - // watershed above half of buffer size make little sense. > - if (temp > config.buffer_size / 2) { > - ostringstream error; > - > - error << "buffer watershed out of range: " << temp > - << " valid range is [0 (use default), buffer size/2] " > - << "generally 0.25 * buffer size is fine"; > - > - QMessageBox::warning(this, 0, error.str().c_str()); > - > - return false; > - } > - config.buffer_watershed = temp; > - > - temp = cpu_buffer_size_edit->text().toUInt(); > - if ((temp != 0 && temp < OP_MIN_CPU_BUF_SIZE) || > - temp > OP_MAX_CPU_BUF_SIZE) { > - ostringstream error; > - > - error << "cpu buffer size out of range: " << temp > - << " valid range is [" << OP_MIN_CPU_BUF_SIZE << ", " > - << OP_MAX_CPU_BUF_SIZE << "] (size = 0: use default)"; > - > - QMessageBox::warning(this, 0, error.str().c_str()); > - > - return false; > - } > - config.cpu_buffer_size = temp; > - > - // Note table size is a 2.4 kernel thingy. We'll just set it to > - // zero here since it's not used. > - // FIXME: Some day we should do a proper cleanup of the GUI to remove > - // all leftover junk having anything to do with 2.4 kernels. > - config.note_table_size = 0; > - > - temp = callgraph_depth_edit->text().toUInt(); > - if (temp > INT_MAX) { > - ostringstream error; > - > - error << "callgraph depth out of range: " << temp > - << " valid range is [" << 0 << ", " > - << INT_MAX << "]"; > - > - QMessageBox::warning(this, 0, error.str().c_str()); > - > - return false; > - } > - config.callgraph_depth = temp; > - > - config.verbose = verbose->isChecked(); > - config.separate_lib = separate_lib_cb->isChecked(); > - config.separate_kernel = separate_kernel_cb->isChecked(); > - config.separate_cpu = separate_cpu_cb->isChecked(); > - config.separate_thread = separate_thread_cb->isChecked(); > - > - return true; > -} > - > - > -void oprof_start::get_unit_mask_part(op_event_descr const & descr, uint num, > - bool selected, uint & mask) > -{ > - if (!selected) > - return; > - if (num >= descr.unit->num) > - return; > - > - if (descr.unit->unit_type_mask == utm_bitmask) > - mask |= descr.unit->um[num].value; > - else > - mask = descr.unit->um[num].value; > -} > - > - > -// return the unit mask selected through the unit mask check box > -uint oprof_start::get_unit_mask(op_event_descr const & descr) > -{ > - uint mask = 0; > - > - if (!descr.unit) > - return 0; > - > - // mandatory mask is transparent for user. > - if (descr.unit->unit_type_mask == utm_mandatory) { > - mask = descr.unit->default_mask; > - return mask; > - } > - > - get_unit_mask_part(descr, 0, check0->isChecked(), mask); > - get_unit_mask_part(descr, 1, check1->isChecked(), mask); > - get_unit_mask_part(descr, 2, check2->isChecked(), mask); > - get_unit_mask_part(descr, 3, check3->isChecked(), mask); > - get_unit_mask_part(descr, 4, check4->isChecked(), mask); > - get_unit_mask_part(descr, 5, check5->isChecked(), mask); > - get_unit_mask_part(descr, 6, check6->isChecked(), mask); > - get_unit_mask_part(descr, 7, check7->isChecked(), mask); > - get_unit_mask_part(descr, 8, check8->isChecked(), mask); > - get_unit_mask_part(descr, 9, check9->isChecked(), mask); > - get_unit_mask_part(descr, 10, check10->isChecked(), mask); > - get_unit_mask_part(descr, 11, check11->isChecked(), mask); > - get_unit_mask_part(descr, 12, check12->isChecked(), mask); > - get_unit_mask_part(descr, 13, check13->isChecked(), mask); > - get_unit_mask_part(descr, 14, check14->isChecked(), mask); > - get_unit_mask_part(descr, 15, check15->isChecked(), mask); > - return mask; > -} > - > - > -void oprof_start::hide_masks() > -{ > - check0->hide(); > - check1->hide(); > - check2->hide(); > - check3->hide(); > - check4->hide(); > - check5->hide(); > - check6->hide(); > - check7->hide(); > - check8->hide(); > - check9->hide(); > - check10->hide(); > - check11->hide(); > - check12->hide(); > - check13->hide(); > - check14->hide(); > - check15->hide(); > -} > - > - > -void oprof_start::setup_unit_masks(op_event_descr const & descr) > -{ > -#define OP_MAX_HANDLED_UMS 16 > - op_unit_mask const * um = descr.unit; > - > - hide_masks(); > - > - if (!um || um->unit_type_mask == utm_mandatory) > - return; > - > - if (um->num > OP_MAX_HANDLED_UMS) { > - ostringstream error; > - > - error << "Number of unit masks (" << um->num << ") is greater than max allowed (" > - << OP_MAX_HANDLED_UMS << ")."; > - QMessageBox::warning(this, 0, error.str().c_str()); > - return; > - } > - > - > - event_setting & cfg = event_cfgs[descr.name]; > - > - unit_mask_group->setExclusive(um->unit_type_mask == utm_exclusive); > - > - QCheckBox * check = NULL; > - > - for (size_t i = 0; i < um->num; ++i) { > - switch (i) { > - case 0: check = check0; break; > - case 1: check = check1; break; > - case 2: check = check2; break; > - case 3: check = check3; break; > - case 4: check = check4; break; > - case 5: check = check5; break; > - case 6: check = check6; break; > - case 7: check = check7; break; > - case 8: check = check8; break; > - case 9: check = check9; break; > - case 10: check = check10; break; > - case 11: check = check11; break; > - case 12: check = check12; break; > - case 13: check = check13; break; > - case 14: check = check14; break; > - case 15: check = check15; break; > - } > - check->setText(um->um[i].desc); > - if (um->unit_type_mask == utm_exclusive) > - check->setChecked(cfg.umask == um->um[i].value); > - else > - check->setChecked(cfg.umask & um->um[i].value); > - > - check->show(); > - } > -} > - > - > -uint oprof_start::max_perf_count() const > -{ > - return cpu_type == CPU_RTC ? OP_MAX_RTC_COUNT : OP_MAX_PERF_COUNT; > -} > - > - > -void oprof_start::on_flush_profiler_data() > -{ > - vector<string> args; > - args.push_back("--dump"); > - > - if (daemon_status().running) > - do_exec_command(OP_BINDIR "/opcontrol", args); > - else > - QMessageBox::warning(this, 0, "The profiler is not started."); > -} > - > - > -// user is happy of its setting. > -void oprof_start::on_start_profiler() > -{ > - // save the current settings > - record_selected_event_config(); > - > - bool one_enable = false; > - > - Q3ListViewItem * cur; > - for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) { > - if (!cur->isSelected()) > - continue; > - > - // the missing reference is intended: gcc 2.91.66 can compile > - // "op_event_descr const & descr = ..." w/o a warning > - op_event_descr const descr = > - locate_event(cur->text(0).latin1()); > - > - event_setting & cfg = event_cfgs[cur->text(0).latin1()]; > - > - one_enable = true; > - > - if (!cfg.os_ring_count && !cfg.user_ring_count) { > - QMessageBox::warning(this, 0, "You must select to " > - "profile at least one of user binaries/kernel"); > - return; > - } > - > - if (cfg.count < descr.min_count || > - cfg.count > max_perf_count()) { > - ostringstream out; > - > - out << "event " << descr.name << " count of range: " > - << cfg.count << " must be in [ " > - << descr.min_count << ", " > - << max_perf_count() > - << "]"; > - > - QMessageBox::warning(this, 0, out.str().c_str()); > - return; > - } > - > - if (descr.unit && > - descr.unit->unit_type_mask == utm_bitmask && > - cfg.umask == 0) { > - ostringstream out; > - > - out << "event " << descr.name << " invalid unit mask: " > - << cfg.umask << endl; > - > - QMessageBox::warning(this, 0, out.str().c_str()); > - return; > - } > - } > - > - if (one_enable == false && cpu_type != CPU_TIMER_INT) { > - QMessageBox::warning(this, 0, "No counters enabled.\n"); > - return; > - } > - > - if (daemon_status().running) { > - // gcc 2.91 work around > - int user_choice = 0; > - user_choice = > - QMessageBox::warning(this, 0, > - "Profiler already started:\n\n" > - "stop and restart it?", > - "&Restart", "&Cancel", 0, 0, 1); > - > - if (user_choice == 1) > - return; > - > - // this flush profiler data also. > - on_stop_profiler(); > - } > - > - vector<string> args; > - > - // save_config validate and setup the config > - if (save_config()) { > - // now actually start > - args.push_back("--start"); > - if (config.verbose) > - args.push_back("--verbose"); > - do_exec_command(OP_BINDIR "/opcontrol", args); > - } > - > - total_nr_interrupts = 0; > - timerEvent(0); > -} > - > - > -bool oprof_start::save_config() > -{ > - if (!record_config()) > - return false; > - > - vector<string> args; > - > - // saving config is done by running opcontrol --setup with appropriate > - // setted parameters so we use the same config file as command line > - // tools > - > - args.push_back("--setup"); > - > - bool one_enabled = false; > - > - vector<string> tmpargs; > - tmpargs.push_back("--setup"); > - > - Q3ListViewItem * cur; > - for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) { > - if (!cur->isSelected()) > - continue; > - > - event_setting & cfg = event_cfgs[cur->text(0).latin1()]; > - > - op_event_descr const & descr = > - locate_event(cur->text(0).latin1()); > - > - one_enabled = true; > - > - string arg = "--event=" + descr.name; > - arg += ":" + op_lexical_cast<string>(cfg.count); > - arg += ":" + op_lexical_cast<string>(cfg.umask); > - arg += ":" + op_lexical_cast<string>(cfg.os_ring_count); > - arg += ":" + op_lexical_cast<string>(cfg.user_ring_count); > - > - tmpargs.push_back(arg); > - } > - > - // only set counters if at least one is enabled > - if (one_enabled) > - args = tmpargs; > - > - if (config.no_kernel) { > - args.push_back("--no-vmlinux"); > - } else { > - args.push_back("--vmlinux=" + config.kernel_filename); > - } > - > - args.push_back("--buffer-size=" + > - op_lexical_cast<string>(config.buffer_size)); > - > - args.push_back("--buffer-watershed=" + > - op_lexical_cast<string>(config.buffer_watershed)); > - args.push_back("--cpu-buffer-size=" + > - op_lexical_cast<string>(config.cpu_buffer_size)); > - if (op_file_readable("/dev/oprofile/backtrace_depth")) { > - args.push_back("--callgraph=" + > - op_lexical_cast<string>(config.callgraph_depth)); > - } > - > - string sep = "--separate="; > - > - if (config.separate_lib) > - sep += "library,"; > - if (config.separate_kernel) > - sep += "kernel,"; > - if (config.separate_cpu) > - sep += "cpu,"; > - if (config.separate_thread) > - sep += "thread,"; > - > - if (sep == "--separate=") > - sep += "none"; > - args.push_back(sep); > - > - // 2.95 work-around, it didn't like return !do_exec_command() > - bool ret = !do_exec_command(OP_BINDIR "/opcontrol", args); > - return ret; > -} > - > - > -// flush and stop the profiler if it was started. > -void oprof_start::on_stop_profiler() > -{ > - vector<string> args; > - args.push_back("--shutdown"); > - > - if (daemon_status().running) > - do_exec_command(OP_BINDIR "/opcontrol", args); > - else > - QMessageBox::warning(this, 0, "The profiler is already stopped."); > - > - timerEvent(0); > -} > - > - > -void oprof_start::on_separate_kernel_cb_changed(int state) > -{ > - if (state == 2) > - separate_lib_cb->setChecked(true); > -} > - > -void oprof_start::on_reset_sample_files() > -{ > - int ret = QMessageBox::warning(this, 0, "Are you sure you want to " > - "reset your last profile session ?", "Yes", "No", 0, 0, 1); > - if (!ret) { > - vector<string> args; > - args.push_back("--reset"); > - if (!do_exec_command(OP_BINDIR "/opcontrol", args)) > - // the next timer event will overwrite the message > - daemon_label->setText("Last profile session reseted."); > - else > - QMessageBox::warning(this, 0, > - "Can't reset profiling session."); > - } > -} > - > - > -/// function object for matching against name > -class event_name_eq { > - string name_; > -public: > - explicit event_name_eq(string const & s) : name_(s) {} > - bool operator()(op_event_descr const & d) const { > - return d.name == name_; > - } > -}; > - > - > -// helper to retrieve an event descr through its name. > -op_event_descr const & oprof_start::locate_event(string const & name) const > -{ > - vector<op_event_descr>::const_iterator it = find_if(v_events.begin(), v_events.end(), > - event_name_eq(name)); > - > - // Failure to find the event should NEVER happen; I had to put this here to silence Coverity. > - if (it != v_events.end()) > - return *it; > - > - QMessageBox::warning((oprof_start *)this, 0, "Could not locate event. Returning null event."); > - null_evt.help_str = ""; > - null_evt.name = ""; > - return null_evt; > -} > diff --git a/gui/oprof_start.h b/gui/oprof_start.h > deleted file mode 100644 > index 477e3f4..0000000 > --- a/gui/oprof_start.h > +++ /dev/null > @@ -1,170 +0,0 @@ > -/** > - * @file oprof_start.h > - * The GUI start main class > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Philippe Elie > - * @author John Levon > - */ > - > -#ifndef OPROF_START_H > -#define OPROF_START_H > - > -#include <vector> > -#include <map> > -#include <set> > - > -#include "config.h" > - > -#include "ui/oprof_start.base.h" > -#include "oprof_start_config.h" > - > -#include "op_events.h" > - > -#ifndef QT3_SUPPORT > -#define Q3ListViewItem QListViewItem > -#endif > - > -class QIntValidator; > -class QListViewItem; > -class QTimerEvent; > - > -/// a struct describing a particular event type > -struct op_event_descr { > - op_event_descr(); > - > - /// bit mask of allowed counters > - uint counter_mask; > - /// hardware event number > - u32 val; > - /// unit mask values if applicable > - op_unit_mask const * unit; > - /// name of event > - std::string name; > - /// description of event > - std::string help_str; > - /// minimum counter value > - uint min_count; > -}; > - > -class oprof_start : public oprof_start_base > -{ > - Q_OBJECT > - > -public: > - oprof_start(); > - > -protected slots: > - /// select the kernel image filename > - void choose_kernel_filename(); > - /// flush profiler > - void on_flush_profiler_data(); > - /// start profiler > - void on_start_profiler(); > - /// stop profiler > - void on_stop_profiler(); > - /// events selection change > - void event_selected(); > - /// the mouse is over an event > - void event_over(Q3ListViewItem *); > - /// state of separate_kernel_cb changed > - void on_separate_kernel_cb_changed(int); > - /// reset sample files > - void on_reset_sample_files(); > - > - /// close the dialog > - void accept(); > - > - /// WM hide event > - void closeEvent(QCloseEvent * e); > - > - /// timer event > - void timerEvent(QTimerEvent * e); > - > -private: > - /// the counter combo has been activated > - void fill_events_listbox(); > - > - /// fill the event details and gui setup > - void fill_events(); > - > - /// find an event description by name > - op_event_descr const & locate_event(std::string const & name) const; > - > - /// update config on user change > - void record_selected_event_config(); > - /// update config and validate > - bool record_config(); > - > - /// calculate unit mask for given event and unit mask part > - void get_unit_mask_part(op_event_descr const & descr, uint num, bool selected, uint & mask); > - /// calculate unit mask for given event > - uint get_unit_mask(op_event_descr const & descr); > - /// set the unit mask widgets for given event > - void setup_unit_masks(op_event_descr const & descr); > - > - /// return the maximum perf counter value for the current cpu type > - uint max_perf_count() const; > - > - /// show an event's settings > - void display_event(op_event_descr const & descrp); > - > - /// hide unit mask widgets > - void hide_masks(void); > - > - /// read the events set in daemonrc > - void read_set_events(); > - /// use the default event > - void setup_default_event(); > - /// load the extra config file > - void load_config_file(); > - /// save the config > - bool save_config(); > - > - /// redraw the event list by changing icon status > - void draw_event_list(); > - > - /// return true if item is selectable or already selected > - bool is_selectable_event(Q3ListViewItem * item); > - > - /// try to alloc counters for the selected_events > - bool alloc_selected_events() const; > - > - /// validator for event count > - QIntValidator* event_count_validator; > - > - /// all available events for this hardware > - std::vector<op_event_descr> v_events; > - > - /// current event configs for each counter > - typedef std::map<std::string, event_setting> event_setting_map; > - event_setting_map event_cfgs; > - > - /// The currently selected events. We must track this because > - /// with multiple selection listbox QT doesn't allow to know > - /// what is the last selected item. events_selected() update it > - std::set<Q3ListViewItem *> selected_events; > - Q3ListViewItem * current_event; > - > - /// current config > - config_setting config; > - > - /// the expansion of "~" directory > - std::string user_dir; > - > - /// CPU type > - op_cpu cpu_type; > - > - /// CPU speed in MHz > - double cpu_speed; > - > - /// total number of available HW counters > - uint op_nr_counters; > - > - /// Total number of samples for this run > - unsigned long total_nr_interrupts; > -}; > - > -#endif // OPROF_START_H > diff --git a/gui/oprof_start_config.cpp b/gui/oprof_start_config.cpp > deleted file mode 100644 > index 9e8120e..0000000 > --- a/gui/oprof_start_config.cpp > +++ /dev/null > @@ -1,104 +0,0 @@ > -/** > - * @file oprof_start_config.cpp > - * GUI startup config management > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#include <stdio.h> > - > -#include <sstream> > -#include <fstream> > -#include <iomanip> > -#include <sys/utsname.h> > - > -#include "string_manip.h" > -#include "oprof_start_config.h" > -#include "op_config.h" > - > -using namespace std; > - > -event_setting::event_setting() > - : > - count(0), > - umask(0), > - os_ring_count(0), > - user_ring_count(0) > -{ > -} > - > - > -config_setting::config_setting() > - : > - buffer_size(OP_DEFAULT_BUF_SIZE), > - note_table_size(0), > - no_kernel(false), > - verbose(false), > - separate_lib(false), > - separate_kernel(false), > - separate_cpu(false), > - separate_thread(false), > - callgraph_depth(0), > - buffer_watershed(0), > - cpu_buffer_size(0) > -{ > - struct utsname info; > - > - /* Guess path to vmlinux based on kernel currently running. */ > - if (uname(&info)) { > - perror("oprof_start: Unable to determine OS release."); > - } else { > - string const version(info.release); > - string const vmlinux_path("/lib/modules/" + version > - + "/build/vmlinux"); > - kernel_filename = vmlinux_path; > - } > -} > - > - > -void config_setting::load(istream & in) > -{ > - string str; > - > - while (getline(in, str)) { > - string val = split(str, '='); > - if (str == "BUF_SIZE") { > - buffer_size = op_lexical_cast<unsigned int>(val); > - if (buffer_size < OP_DEFAULT_BUF_SIZE) > - buffer_size = OP_DEFAULT_BUF_SIZE; > - } else if (str == "VMLINUX") { > - if (val == "none") { > - kernel_filename = ""; > - no_kernel = true; > - } else if (!val.empty()) { > - no_kernel = false; > - kernel_filename = val; > - } > - } else if (str == "SEPARATE_LIB") { > - separate_lib = op_lexical_cast<bool>(val); > - } else if (str == "SEPARATE_KERNEL") { > - separate_kernel = op_lexical_cast<bool>(val); > - } else if (str == "SEPARATE_CPU") { > - separate_cpu = op_lexical_cast<bool>(val); > - } else if (str == "SEPARATE_THREAD") { > - separate_thread = op_lexical_cast<bool>(val); > - } else if (str == "CALLGRAPH") { > - callgraph_depth = op_lexical_cast<unsigned int>(val); > - } else if (str == "BUF_WATERSHED") { > - buffer_watershed = op_lexical_cast<unsigned int>(val); > - } else if (str == "CPU_BUF_SIZE") { > - cpu_buffer_size = op_lexical_cast<unsigned int>(val); > - } > - } > -} > - > - > -istream & operator>>(istream & in, config_setting & object) > -{ > - object.load(in); > - return in; > -} > diff --git a/gui/oprof_start_config.h b/gui/oprof_start_config.h > deleted file mode 100644 > index 07b25d8..0000000 > --- a/gui/oprof_start_config.h > +++ /dev/null > @@ -1,56 +0,0 @@ > -/** > - * @file oprof_start_config.h > - * GUI startup config management > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#ifndef OPROF_START_CONFIG_H > -#define OPROF_START_CONFIG_H > - > -#include <sys/types.h> > -#include <string> > -#include <iosfwd> > - > -/// Store the setup of one event > -struct event_setting { > - > - event_setting(); > - > - uint count; > - uint umask; > - bool os_ring_count; > - bool user_ring_count; > -}; > - > -/** > - * Store the general configuration of the profiler. > - * There is no save(), instead opcontrol --setup must be > - * called. This uses opcontrol's daemonrc file. > - */ > -struct config_setting { > - config_setting(); > - > - void load(std::istream & in); > - > - uint buffer_size; > - uint note_table_size; > - std::string kernel_filename; > - bool no_kernel; > - bool verbose; > - bool separate_lib; > - bool separate_kernel; > - bool separate_cpu; > - bool separate_thread; > - uint callgraph_depth; > - uint buffer_watershed; > - uint cpu_buffer_size; > -}; > - > -std::istream & operator>>(std::istream & in, config_setting & object); > - > -#endif // ! OPROF_START_CONFIG_H > diff --git a/gui/oprof_start_main.cpp b/gui/oprof_start_main.cpp > deleted file mode 100644 > index e3fad1e..0000000 > --- a/gui/oprof_start_main.cpp > +++ /dev/null > @@ -1,37 +0,0 @@ > -/** > - * @file oprof_start_main.cpp > - * main routine for GUI start > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Philippe Elie > - * @author John Levon > - */ > - > -#include <qapplication.h> > -#include <stdlib.h> > -#include <exception> > -#include <iostream> > - > -#include "oprof_start.h" > - > -using namespace std; > -int main(int argc, char* argv[]) > -{ > - QApplication a(argc, argv); > - oprof_start* dlg; > - > - try { > - dlg = new oprof_start(); > - } catch (exception e) { > - cerr << "Initialization error: " << e.what() << endl; > - exit(EXIT_FAILURE); > - } > - > - a.setMainWidget(dlg); > - > - dlg->show(); > - > - return a.exec(); > -} > diff --git a/gui/oprof_start_util.cpp b/gui/oprof_start_util.cpp > deleted file mode 100644 > index 995ea64..0000000 > --- a/gui/oprof_start_util.cpp > +++ /dev/null > @@ -1,324 +0,0 @@ > -/** > - * @file oprof_start_util.cpp > - * Miscellaneous helpers for the GUI start > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Philippe Elie > - * @author John Levon > - */ > - > -#include <dirent.h> > -#include <unistd.h> > -#include <glob.h> > - > -#include <cerrno> > -#include <vector> > -#include <cmath> > -#include <sstream> > -#include <iostream> > -#include <fstream> > -#include <cstdlib> > - > -#include <qfiledialog.h> > -#include <qmessagebox.h> > - > -#include "op_file.h" > -#include "file_manip.h" > -#include "child_reader.h" > -#include "op_libiberty.h" > - > -#include "oprof_start.h" > -#include "oprof_start_util.h" > - > -using namespace std; > - > -namespace { > - > -// return the ~ expansion suffixed with a '/' > -string const get_config_dir() > -{ > - return "/root"; > -} > - > -string daemon_pid; > - > -} // namespace anon > - > -daemon_status::daemon_status() > - : running(false), > - nr_interrupts(0) > -{ > - int HZ; > - if (!daemon_pid.empty()) { > - string proc_filename = string("/proc/") + daemon_pid + "/exe"; > - string const exec = op_realpath(proc_filename); > - if (exec == proc_filename) > - daemon_pid.erase(); > - else > - running = true; > - } > - > - if (daemon_pid.empty()) { > - DIR * dir; > - struct dirent * dirent; > - > - if (!(dir = opendir("/proc"))) { > - perror("oprofiled: /proc directory could not be opened. "); > - exit(EXIT_FAILURE); > - } > - > - while ((dirent = readdir(dir))) { > - string const exec = > - op_realpath(string("/proc/") > - + dirent->d_name + "/exe"); > - string const name = op_basename(exec); > - if (name != "oprofiled") > - continue; > - > - daemon_pid = dirent->d_name; > - running = true; > - } > - > - closedir(dir); > - } > - > - HZ = sysconf(_SC_CLK_TCK); > - if (HZ == -1) { > - perror("oprofiled: Unable to determine clock ticks per second. "); > - exit(EXIT_FAILURE); > - } > - > - if (daemon_pid.empty()) > - return; > - > - nr_interrupts = 0; > - > - switch (op_get_interface()) { > - case OP_INTERFACE_26: > - { > - static unsigned int old_sum_interrupts; > - unsigned int sum_interrupts = 0; > - glob_t file_names; > - > - file_names.gl_offs = 0; > - glob("/dev/oprofile/stats/cpu*/sample_received", > - GLOB_DOOFFS, NULL, &file_names); > - > - for (size_t i = 0; i < file_names.gl_pathc; ++i) { > - ifstream ifs3(file_names.gl_pathv[i]); > - if (ifs3) { > - unsigned int file_interrupts; > - ifs3 >> file_interrupts; > - sum_interrupts += file_interrupts; > - } > - } > - if (old_sum_interrupts > sum_interrupts) > - // occur if we stop/restart daemon. > - old_sum_interrupts = 0; > - nr_interrupts = sum_interrupts - old_sum_interrupts; > - old_sum_interrupts = sum_interrupts; > - globfree(&file_names); > - } > - break; > - default: > - break; > - } > -} > - > - > -/** > - * get_config_filename - get absolute filename of file in user $HOME > - * @param filename the relative filename > - * > - * Get the absolute path of a file in a user's home directory. > - */ > -string const get_config_filename(string const & filename) > -{ > - return get_config_dir() + "/" + filename; > -} > - > - > -/** > - * check_and_create_config_dir - make sure config dir is accessible > - * > - * Returns %true if the dir is accessible. > - */ > -bool check_and_create_config_dir() > -{ > - string dir = get_config_filename(".oprofile"); > - > - char * name = xstrdup(dir.c_str()); > - > - if (create_dir(name)) { > - ostringstream out; > - out << "unable to create " << dir << " directory "; > - out << "cause: " << strerror(errno); > - QMessageBox::warning(0, 0, out.str().c_str()); > - > - free(name); > - > - return false; > - } > - > - free(name); > - return true; > -} > - > - > -/** > - * format - re-format a string > - * @param orig string to format > - * @param maxlen width of line > - * > - * Re-formats a string to fit into a certain width, > - * breaking lines at spaces between words. > - * > - * Returns the formatted string > - */ > -string const format(string const & orig, uint const maxlen) > -{ > - string text(orig); > - > - istringstream ss(text); > - vector<string> lines; > - > - string oline; > - string line; > - > - while (getline(ss, oline)) { > - if (line.size() + oline.size() < maxlen) { > - lines.push_back(line + oline); > - line.erase(); > - } else { > - lines.push_back(line); > - line.erase(); > - string s; > - string word; > - istringstream oss(oline); > - while (oss >> word) { > - if (line.size() + word.size() > maxlen) { > - lines.push_back(line); > - line.erase(); > - } > - line += word + " "; > - } > - } > - } > - > - if (line.size()) > - lines.push_back(line); > - > - string ret; > - > - for(vector<string>::const_iterator it = lines.begin(); it != lines.end(); ++it) > - ret += *it + "\n"; > - > - return ret; > -} > - > - > -/** > - * do_exec_command - execute a command > - * @param cmd command name > - * @param args arguments to command > - * > - * Execute a command synchronously. An error message is shown > - * if the command returns a non-zero status, which is also returned. > - * > - * The arguments are verified and will refuse to execute if they contain > - * shell metacharacters. > - */ > -int do_exec_command(string const & cmd, vector<string> const & args) > -{ > - ostringstream err; > - bool ok = true; > - > - // verify arguments > - for (vector<string>::const_iterator cit = args.begin(); > - cit != args.end(); ++cit) { > - if (verify_argument(*cit)) > - continue; > - > - QMessageBox::warning(0, 0, > - string( > - "Could not execute: Argument \"" + *cit + > - "\" contains shell metacharacters.\n").c_str()); > - return EINVAL; > - } > - > - child_reader reader(cmd, args); > - if (reader.error()) > - ok = false; > - > - if (ok) > - reader.get_data(cout, err); > - > - int ret = reader.terminate_process(); > - if (ret) { > - string error = reader.error_str() + "\n"; > - error += "Failed: \n" + err.str() + "\n"; > - string cmdline = cmd; > - for (vector<string>::const_iterator cit = args.begin(); > - cit != args.end(); ++cit) { > - cmdline += " " + *cit + " "; > - } > - error += "\n\nCommand was :\n\n" + cmdline + "\n"; > - > - QMessageBox::warning(0, 0, format(error, 50).c_str()); > - } > - > - return ret; > -} > - > - > -/** > - * do_open_file_or_dir - open file/directory > - * @param base_dir directory to start at > - * @param dir_only directory or filename to select > - * > - * Select a file or directory. The selection is returned; > - * an empty string if the selection was cancelled. > - */ > -string const do_open_file_or_dir(string const & base_dir, bool dir_only) > -{ > - QString result; > - > - if (dir_only) { > - result = QFileDialog::getExistingDirectory(base_dir.c_str(), 0, > - "open_file_or_dir", "Get directory name", true); > - } else { > - result = QFileDialog::getOpenFileName(base_dir.c_str(), 0, 0, > - "open_file_or_dir", "Get filename"); > - } > - > - if (result.isNull()) > - return string(); > - else > - return result.latin1(); > -} > - > -/** > - * verify_argument - check string for potentially dangerous characters > - * > - * This function returns false if the string contains dangerous shell > - * metacharacters. > - * > - * WWW Security FAQ dangerous chars: > - * > - * & ; ` ' \ " | * ? ~ < > ^ ( ) [ ] { } $ \n \r > - * > - * David Wheeler: ! # > - * > - * We allow '-' because we disallow whitespace. We allow ':' and '=' > - */ > -bool verify_argument(string const & str) > -{ > - if (str.find_first_not_of( > - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" > - "abcdefghijklmnopqrstuvwxyz0123456789_:=-+%,./") > - != string::npos) > - return false; > - return true; > -} > diff --git a/gui/oprof_start_util.h b/gui/oprof_start_util.h > deleted file mode 100644 > index cce646d..0000000 > --- a/gui/oprof_start_util.h > +++ /dev/null > @@ -1,39 +0,0 @@ > -/** > - * @file oprof_start_util.h > - * Miscellaneous helpers for the GUI start > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Philippe Elie > - * @author John Levon > - */ > - > -#ifndef OPROF_START_UTIL_H > -#define OPROF_START_UTIL_H > - > -#include <cmath> > -#include <string> > -#include <vector> > - > -/// Store various daemon status data > -struct daemon_status { > - /// fill various data member according to the current daemon status > - daemon_status(); > - bool running; ///< true if daemon is running > - unsigned int nr_interrupts; ///< nr_interrupts from profiling start > -}; > - > -inline double ratio(double x1, double x2) > -{ > - return fabs(((x1 - x2) / x2)) * 100; > -} > - > -std::string const get_config_filename(std::string const & filename); > -bool check_and_create_config_dir(); > -std::string const format(std::string const & orig, uint const maxlen); > -int do_exec_command(std::string const & cmd, std::vector<std::string> const & args = std::vector<std::string>()); > -std::string const do_open_file_or_dir(std::string const & base_dir, bool dir_only); > -bool verify_argument(std::string const & str); > - > -#endif // OPROF_START_UTIL_H > diff --git a/gui/ui/.gitignore b/gui/ui/.gitignore > deleted file mode 100644 > index ea15426..0000000 > --- a/gui/ui/.gitignore > +++ /dev/null > @@ -1,6 +0,0 @@ > -.deps > -oprof_start.base.cpp > -oprof_start.base.moc.cpp > -oprof_start.base.h > -Makefile > -Makefile.in > diff --git a/gui/ui/Makefile.am b/gui/ui/Makefile.am > deleted file mode 100644 > index 235d370..0000000 > --- a/gui/ui/Makefile.am > +++ /dev/null > @@ -1,24 +0,0 @@ > -EXTRA_DIST = oprof_start.base.ui > - > -if have_qt > - > -AM_CPPFLAGS = @QT_CFLAGS@ @OP_CPPFLAGS@ > - > -AM_CXXFLAGS = @OP_CXXFLAGS@ > - > -noinst_LIBRARIES = liboprof_start.a > -nodist_liboprof_start_a_SOURCES = oprof_start.base.cpp oprof_start.base.moc.cpp > - > -oprof_start.base.h: oprof_start.base.ui > - $(UIC) -o $@ $< > - > -oprof_start.base.cpp: oprof_start.base.h oprof_start.base.ui > - $(UIC) -o $@ -impl $^ > - > -oprof_start.base.moc.cpp: oprof_start.base.h > - $(MOC) -o $@ $< > - > -clean-local: > - rm -f oprof_start.base.h oprof_start.base.cpp oprof_start.base.moc.cpp > - > -endif > diff --git a/gui/ui/oprof_start.base.ui b/gui/ui/oprof_start.base.ui > deleted file mode 100644 > index 4fcc43f..0000000 > --- a/gui/ui/oprof_start.base.ui > +++ /dev/null > @@ -1,1190 +0,0 @@ > -<!DOCTYPE UI><UI> > -<class>oprof_start_base</class> > -<widget> > - <class>QDialog</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>oprof_start_base</cstring> > - </property> > - <property stdset="1"> > - <name>geometry</name> > - <rect> > - <x>0</x> > - <y>0</y> > - <width>625</width> > - <height>735</height> > - </rect> > - </property> > - <property stdset="1"> > - <name>caption</name> > - <string>Start profiler</string> > - </property> > - <property stdset="1"> > - <name>sizeGripEnabled</name> > - <bool>true</bool> > - </property> > - <vbox> > - <property stdset="1"> > - <name>margin</name> > - <number>11</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QTabWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>setup_config_tab</cstring> > - </property> > - <widget> > - <class>QWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>counter_setup_page</cstring> > - </property> > - <attribute> > - <name>title</name> > - <string>&Setup</string> > - </attribute> > - <vbox> > - <property stdset="1"> > - <name>margin</name> > - <number>11</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QGroupBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>counter_group</cstring> > - </property> > - <property stdset="1"> > - <name>title</name> > - <string>Events</string> > - </property> > - <vbox> > - <property stdset="1"> > - <name>margin</name> > - <number>11</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout10</cstring> > - </property> > - <hbox> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QListView</class> > - <column> > - <property> > - <name>text</name> > - <string>Removedincode</string> > - </property> > - <property> > - <name>clickable</name> > - <bool>false</bool> > - </property> > - <property> > - <name>resizeable</name> > - <bool>true</bool> > - </property> > - </column> > - <property stdset="1"> > - <name>name</name> > - <cstring>events_list</cstring> > - </property> > - <property stdset="1"> > - <name>minimumSize</name> > - <size> > - <width>250</width> > - <height>0</height> > - </size> > - </property> > - <property stdset="1"> > - <name>selectionMode</name> > - <enum>Multi</enum> > - </property> > - <property> > - <name>toolTip</name> > - <string>Available events</string> > - </property> > - </widget> > - <widget> > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout9</cstring> > - </property> > - <vbox> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>os_ring_count_cb</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Profile &kernel</string> > - </property> > - <property> > - <name>toolTip</name> > - <string>Profile kernel code</string> > - </property> > - </widget> > - <widget> > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>user_ring_count_cb</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Profile &user binaries</string> > - </property> > - <property> > - <name>toolTip</name> > - <string>Profile user libraries and applications</string> > - </property> > - </widget> > - <widget> > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout16</cstring> > - </property> > - <hbox> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QLabel</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>TextLabel1_2</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>C&ount</string> > - </property> > - <property> > - <name>buddy</name> > - <cstring>event_count_edit</cstring> > - </property> > - </widget> > - <widget> > - <class>QLineEdit</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>event_count_edit</cstring> > - </property> > - <property stdset="1"> > - <name>sizePolicy</name> > - <sizepolicy> > - <hsizetype>1</hsizetype> > - <vsizetype>0</vsizetype> > - </sizepolicy> > - </property> > - <property> > - <name>toolTip</name> > - <string>Set the count value</string> > - </property> > - </widget> > - <spacer> > - <property> > - <name>name</name> > - <cstring>Spacer13_2</cstring> > - </property> > - <property stdset="1"> > - <name>orientation</name> > - <enum>Horizontal</enum> > - </property> > - <property stdset="1"> > - <name>sizeType</name> > - <enum>Expanding</enum> > - </property> > - <property> > - <name>sizeHint</name> > - <size> > - <width>20</width> > - <height>20</height> > - </size> > - </property> > - </spacer> > - </hbox> > - </widget> > - <widget> > - <class>QButtonGroup</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>unit_mask_group</cstring> > - </property> > - <property stdset="1"> > - <name>sizePolicy</name> > - <sizepolicy> > - <hsizetype>1</hsizetype> > - <vsizetype>5</vsizetype> > - </sizepolicy> > - </property> > - <property stdset="1"> > - <name>title</name> > - <string>Unit mask</string> > - </property> > - <property> > - <name>toolTip</name> > - <string>Unit mask settings for this event</string> > - </property> > - <grid> > - <property stdset="1"> > - <name>margin</name> > - <number>11</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget row="0" column="0" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check0</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check0</string> > - </property> > - </widget> > - <widget row="1" column="0" rowspan="2" colspan="2" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check1</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check1</string> > - </property> > - </widget> > - <widget row="3" column="0" rowspan="2" colspan="2" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check2</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check2</string> > - </property> > - </widget> > - <widget row="5" column="0" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check3</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check3</string> > - </property> > - </widget> > - <widget row="6" column="0" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check4</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check4</string> > - </property> > - </widget> > - <widget row="7" column="0" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check5</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check5</string> > - </property> > - </widget> > - <widget row="8" column="0" rowspan="2" colspan="2" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check6</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check6</string> > - </property> > - </widget> > - <widget row="10" column="0" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check7</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check7</string> > - </property> > - </widget> > - <spacer row="11" column="1" > > - <property> > - <name>name</name> > - <cstring>Spacer14</cstring> > - </property> > - <property stdset="1"> > - <name>orientation</name> > - <enum>Vertical</enum> > - </property> > - <property stdset="1"> > - <name>sizeType</name> > - <enum>Expanding</enum> > - </property> > - <property> > - <name>sizeHint</name> > - <size> > - <width>20</width> > - <height>20</height> > - </size> > - </property> > - </spacer> > - <widget row="5" column="1" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check11</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check11</string> > - </property> > - </widget> > - <widget row="7" column="1" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check13</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check13</string> > - </property> > - </widget> > - <widget row="10" column="1" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check15</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check15</string> > - </property> > - </widget> > - <widget row="4" column="1" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check10</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check10</string> > - </property> > - </widget> > - <widget row="9" column="1" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check14</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check14</string> > - </property> > - </widget> > - <widget row="2" column="1" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check9</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check9</string> > - </property> > - </widget> > - <widget row="0" column="1" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check8</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check8</string> > - </property> > - </widget> > - <widget row="6" column="1" > > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>check12</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>check12</string> > - </property> > - </widget> > - </grid> > - </widget> > - </vbox> > - </widget> > - </hbox> > - </widget> > - <widget> > - <class>QLabel</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>event_help_label</cstring> > - </property> > - <property stdset="1"> > - <name>enabled</name> > - <bool>true</bool> > - </property> > - <property stdset="1"> > - <name>sizePolicy</name> > - <sizepolicy> > - <hsizetype>1</hsizetype> > - <vsizetype>1</vsizetype> > - </sizepolicy> > - </property> > - <property stdset="1"> > - <name>frameShape</name> > - <enum>WinPanel</enum> > - </property> > - <property stdset="1"> > - <name>frameShadow</name> > - <enum>Sunken</enum> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string></string> > - </property> > - </widget> > - </vbox> > - </widget> > - </vbox> > - </widget> > - <widget> > - <class>QWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>configuration_page</cstring> > - </property> > - <attribute> > - <name>title</name> > - <string>&Configuration</string> > - </attribute> > - <vbox> > - <property stdset="1"> > - <name>margin</name> > - <number>11</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout11</cstring> > - </property> > - <hbox> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QLabel</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>TextLabel1</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>&Kernel image file</string> > - </property> > - <property> > - <name>buddy</name> > - <cstring>kernel_filename_edit</cstring> > - </property> > - </widget> > - <widget> > - <class>QLineEdit</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>kernel_filename_edit</cstring> > - </property> > - <property> > - <name>toolTip</name> > - <string>The vmlinux file of the running kernel</string> > - </property> > - </widget> > - <widget> > - <class>QToolButton</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>kernel_filename_tb</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>...</string> > - </property> > - </widget> > - <widget> > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>no_vmlinux</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>No kernel image</string> > - </property> > - <property> > - <name>toolTip</name> > - <string>No kernel image available. Disables kernel profiling.</string> > - </property> > - </widget> > - </hbox> > - </widget> > - <widget> > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout12</cstring> > - </property> > - <hbox> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout11</cstring> > - </property> > - <grid> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget row="0" column="1" > > - <class>QLineEdit</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>buffer_size_edit</cstring> > - </property> > - <property> > - <name>toolTip</name> > - <string>The size of the profiler's buffers</string> > - </property> > - </widget> > - <widget row="1" column="1" > > - <class>QLineEdit</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>note_table_size_edit</cstring> > - </property> > - </widget> > - <widget row="3" column="0" > > - <class>QLabel</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>cpu_buffer_size_label</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Cpu buffer size</string> > - </property> > - <property> > - <name>buddy</name> > - <cstring>cpu_buffer_size_edit</cstring> > - </property> > - </widget> > - <widget row="3" column="1" > > - <class>QLineEdit</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>cpu_buffer_size_edit</cstring> > - </property> > - </widget> > - <widget row="0" column="0" > > - <class>QLabel</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>buffer_size_label</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>&Buffer size</string> > - </property> > - <property> > - <name>buddy</name> > - <cstring>buffer_size_edit</cstring> > - </property> > - </widget> > - <widget row="1" column="0" > > - <class>QLabel</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>note_table_size_label</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Note Size</string> > - </property> > - <property> > - <name>buddy</name> > - <cstring>note_table_size_edit</cstring> > - </property> > - </widget> > - <widget row="2" column="1" > > - <class>QLineEdit</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>buffer_watershed_edit</cstring> > - </property> > - </widget> > - <widget row="2" column="0" > > - <class>QLabel</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>buffer_watershed_label</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Buffer watershed</string> > - </property> > - <property> > - <name>buddy</name> > - <cstring>buffer_watershed_edit</cstring> > - </property> > - </widget> > - </grid> > - </widget> > - <spacer> > - <property> > - <name>name</name> > - <cstring>Spacer11</cstring> > - </property> > - <property stdset="1"> > - <name>orientation</name> > - <enum>Horizontal</enum> > - </property> > - <property stdset="1"> > - <name>sizeType</name> > - <enum>Expanding</enum> > - </property> > - <property> > - <name>sizeHint</name> > - <size> > - <width>20</width> > - <height>20</height> > - </size> > - </property> > - </spacer> > - </hbox> > - </widget> > - <widget> > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout36</cstring> > - </property> > - <grid> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget row="0" column="0" > > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout34</cstring> > - </property> > - <vbox> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>verbose</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>&Verbose</string> > - </property> > - <property> > - <name>toolTip</name> > - <string>Very verbose output in log file</string> > - </property> > - </widget> > - <widget> > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>separate_lib_cb</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Per-application profiles</string> > - </property> > - <property> > - <name>toolTip</name> > - <string>Separate samples for each shared library. This increases the time and space overhead of OProfile.</string> > - </property> > - </widget> > - <widget> > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>separate_kernel_cb</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Per-application profiles, including kernel</string> > - </property> > - <property> > - <name>toolTip</name> > - <string>Separate samples for each shared library and kernel samples. This increases the time and space overhead of OProfile.</string> > - </property> > - </widget> > - <widget> > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>separate_cpu_cb</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Per-CPU profiles</string> > - </property> > - <property> > - <name>toolTip</name> > - <string>Separate samples for each shared library and kernel samples. This increases the time and space overhead of OProfile.</string> > - </property> > - </widget> > - <widget> > - <class>QCheckBox</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>separate_thread_cb</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Per-thread/task profiles</string> > - </property> > - <property> > - <name>toolTip</name> > - <string>Separate samples for each shared library and kernel samples. This increases the time and space overhead of OProfile.</string> > - </property> > - </widget> > - <widget> > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout33</cstring> > - </property> > - <hbox> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QLabel</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>callgraph_depth_label</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>callgraph depth, zero to disable</string> > - </property> > - <property> > - <name>buddy</name> > - <cstring>callgraph_depth_edit</cstring> > - </property> > - </widget> > - <widget> > - <class>QLineEdit</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>callgraph_depth_edit</cstring> > - </property> > - </widget> > - </hbox> > - </widget> > - </vbox> > - </widget> > - <spacer row="0" column="1" > > - <property> > - <name>name</name> > - <cstring>Spacer12</cstring> > - </property> > - <property stdset="1"> > - <name>orientation</name> > - <enum>Horizontal</enum> > - </property> > - <property stdset="1"> > - <name>sizeType</name> > - <enum>Expanding</enum> > - </property> > - <property> > - <name>sizeHint</name> > - <size> > - <width>20</width> > - <height>20</height> > - </size> > - </property> > - </spacer> > - </grid> > - </widget> > - <spacer> > - <property> > - <name>name</name> > - <cstring>Spacer9</cstring> > - </property> > - <property stdset="1"> > - <name>orientation</name> > - <enum>Vertical</enum> > - </property> > - <property stdset="1"> > - <name>sizeType</name> > - <enum>Expanding</enum> > - </property> > - <property> > - <name>sizeHint</name> > - <size> > - <width>20</width> > - <height>20</height> > - </size> > - </property> > - </spacer> > - </vbox> > - </widget> > - </widget> > - <widget> > - <class>QLabel</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>daemon_label</cstring> > - </property> > - <property stdset="1"> > - <name>frameShape</name> > - <enum>Panel</enum> > - </property> > - <property stdset="1"> > - <name>frameShadow</name> > - <enum>Sunken</enum> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string></string> > - </property> > - <property> > - <name>toolTip</name> > - <string>Current daemon status</string> > - </property> > - </widget> > - <widget> > - <class>QLayoutWidget</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>Layout37</cstring> > - </property> > - <hbox> > - <property stdset="1"> > - <name>margin</name> > - <number>0</number> > - </property> > - <property stdset="1"> > - <name>spacing</name> > - <number>6</number> > - </property> > - <widget> > - <class>QPushButton</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>start_profiler_btn</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>St&art</string> > - </property> > - </widget> > - <widget> > - <class>QPushButton</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>flush_profiler_data_btn</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>&Flush</string> > - </property> > - </widget> > - <widget> > - <class>QPushButton</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>stop_profiler_btn</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Stop</string> > - </property> > - </widget> > - <spacer> > - <property> > - <name>name</name> > - <cstring>Spacer5</cstring> > - </property> > - <property stdset="1"> > - <name>orientation</name> > - <enum>Horizontal</enum> > - </property> > - <property stdset="1"> > - <name>sizeType</name> > - <enum>Expanding</enum> > - </property> > - <property> > - <name>sizeHint</name> > - <size> > - <width>20</width> > - <height>20</height> > - </size> > - </property> > - </spacer> > - <widget> > - <class>QPushButton</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>reset_sample_files_btn</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Reset sample files</string> > - </property> > - </widget> > - <widget> > - <class>QPushButton</class> > - <property stdset="1"> > - <name>name</name> > - <cstring>quit_and_save_btn</cstring> > - </property> > - <property stdset="1"> > - <name>text</name> > - <string>Save and &quit</string> > - </property> > - <property stdset="1"> > - <name>autoDefault</name> > - <bool>true</bool> > - </property> > - </widget> > - </hbox> > - </widget> > - </vbox> > -</widget> > -<connections> > - <connection> > - <sender>start_profiler_btn</sender> > - <signal>clicked()</signal> > - <receiver>oprof_start_base</receiver> > - <slot>on_start_profiler()</slot> > - </connection> > - <connection> > - <sender>stop_profiler_btn</sender> > - <signal>clicked()</signal> > - <receiver>oprof_start_base</receiver> > - <slot>on_stop_profiler()</slot> > - </connection> > - <connection> > - <sender>flush_profiler_data_btn</sender> > - <signal>clicked()</signal> > - <receiver>oprof_start_base</receiver> > - <slot>on_flush_profiler_data()</slot> > - </connection> > - <connection> > - <sender>quit_and_save_btn</sender> > - <signal>clicked()</signal> > - <receiver>oprof_start_base</receiver> > - <slot>accept()</slot> > - </connection> > - <connection> > - <sender>kernel_filename_tb</sender> > - <signal>clicked()</signal> > - <receiver>oprof_start_base</receiver> > - <slot>choose_kernel_filename()</slot> > - </connection> > - <connection> > - <sender>no_vmlinux</sender> > - <signal>toggled(bool)</signal> > - <receiver>kernel_filename_tb</receiver> > - <slot>setDisabled(bool)</slot> > - </connection> > - <connection> > - <sender>no_vmlinux</sender> > - <signal>toggled(bool)</signal> > - <receiver>kernel_filename_edit</receiver> > - <slot>setDisabled(bool)</slot> > - </connection> > - <connection> > - <sender>no_vmlinux</sender> > - <signal>toggled(bool)</signal> > - <receiver>TextLabel1</receiver> > - <slot>setDisabled(bool)</slot> > - </connection> > - <connection> > - <sender>separate_kernel_cb</sender> > - <signal>stateChanged(int)</signal> > - <receiver>oprof_start_base</receiver> > - <slot>on_separate_kernel_cb_changed(int)</slot> > - </connection> > - <connection> > - <sender>reset_sample_files_btn</sender> > - <signal>clicked()</signal> > - <receiver>oprof_start_base</receiver> > - <slot>on_reset_sample_files()</slot> > - </connection> > - <connection> > - <sender>events_list</sender> > - <signal>selectionChanged()</signal> > - <receiver>oprof_start_base</receiver> > - <slot>event_selected()</slot> > - </connection> > - <connection> > - <sender>events_list</sender> > - <signal>currentChanged(QListViewItem*)</signal> > - <receiver>oprof_start_base</receiver> > - <slot>event_over(QListViewItem *)</slot> > - </connection> > - <connection> > - <sender>events_list</sender> > - <signal>onItem(QListViewItem*)</signal> > - <receiver>oprof_start_base</receiver> > - <slot>event_over(QListViewItem *)</slot> > - </connection> > - <slot access="protected">choose_kernel_filename()</slot> > - <slot access="protected">event_over(QListViewItem *)</slot> > - <slot access="protected">event_selected()</slot> > - <slot access="protected">on_reset_sample_files()</slot> > - <slot access="protected">on_flush_profiler_data()</slot> > - <slot access="protected">on_separate_kernel_cb_changed(int)</slot> > - <slot access="protected">on_start_profiler()</slot> > - <slot access="protected">on_stop_profiler()</slot> > -</connections> > -<tabstops> > - <tabstop>setup_config_tab</tabstop> > - <tabstop>events_list</tabstop> > - <tabstop>os_ring_count_cb</tabstop> > - <tabstop>user_ring_count_cb</tabstop> > - <tabstop>event_count_edit</tabstop> > - <tabstop>check0</tabstop> > - <tabstop>check1</tabstop> > - <tabstop>check2</tabstop> > - <tabstop>check3</tabstop> > - <tabstop>check4</tabstop> > - <tabstop>check5</tabstop> > - <tabstop>check6</tabstop> > - <tabstop>check7</tabstop> > - <tabstop>check8</tabstop> > - <tabstop>check9</tabstop> > - <tabstop>check10</tabstop> > - <tabstop>check11</tabstop> > - <tabstop>check12</tabstop> > - <tabstop>check13</tabstop> > - <tabstop>check14</tabstop> > - <tabstop>check15</tabstop> > - <tabstop>start_profiler_btn</tabstop> > - <tabstop>flush_profiler_data_btn</tabstop> > - <tabstop>stop_profiler_btn</tabstop> > - <tabstop>reset_sample_files_btn</tabstop> > - <tabstop>quit_and_save_btn</tabstop> > - <tabstop>kernel_filename_edit</tabstop> > - <tabstop>no_vmlinux</tabstop> > - <tabstop>buffer_size_edit</tabstop> > - <tabstop>note_table_size_edit</tabstop> > - <tabstop>buffer_watershed_edit</tabstop> > - <tabstop>verbose</tabstop> > - <tabstop>separate_lib_cb</tabstop> > - <tabstop>separate_kernel_cb</tabstop> > - <tabstop>separate_cpu_cb</tabstop> > - <tabstop>separate_thread_cb</tabstop> > - <tabstop>callgraph_depth_edit</tabstop> > -</tabstops> > -</UI> > diff --git a/libop/Makefile.am b/libop/Makefile.am > index 3358dfb..0452f70 100644 > --- a/libop/Makefile.am > +++ b/libop/Makefile.am > @@ -13,8 +13,6 @@ libop_a_SOURCES = \ > op_cpu_type.h \ > op_mangle.c \ > op_mangle.h \ > - op_get_interface.c \ > - op_interface.h \ > op_alloc_counter.c \ > op_alloc_counter.h \ > op_hw_config.h \ > diff --git a/libop/op_alloc_counter.c b/libop/op_alloc_counter.c > index 7aec316..1595e5e 100644 > --- a/libop/op_alloc_counter.c > +++ b/libop/op_alloc_counter.c > @@ -109,17 +109,17 @@ static void delete_counter_arc(counter_arc_head * ctr_arc, int nr_events) > * mapping number. > * > * Solution is searched through a simple backtracking exploring recursively all > - * possible solution until one is found, prunning is done in O(1) by tracking > + * possible solution until one is found, pruning is done in O(1) by tracking > * a bitmask of already allocated counter. Walking through node is done in > * preorder left to right. > * > - * In case of extended events (required no phisical counters), the associated > + * In case of extended events (required no physical counters), the associated > * counter_map entry will be -1. > * > - * Possible improvment if neccessary: partition counters in class of counter, > + * Possible improvement if necessary: partition counters in class of counter, > * two counter belong to the same class if they allow exactly the same set of > * event. Now using a variant of the backtrack algo can works on class of > - * counter rather on counter (this is not an improvment if each counter goes > + * counter rather on counter (this is not an improvement if each counter goes > * in it's own class) > */ > static int > @@ -157,47 +157,6 @@ allocate_counter(counter_arc_head const * ctr_arc, int max_depth, int depth, > return 0; > } > > -/* determine which directories are counter directories > - */ > -static int perfcounterdir(const struct dirent * entry) > -{ > - return (isdigit(entry->d_name[0])); > -} > - > - > -/** > - * @param mask pointer where to place bit mask of unavailable counters > - * > - * return >= 0 number of counters that are available > - * < 0 could not determine number of counters > - * > - */ > -static int op_get_counter_mask(u32 * mask) > -{ > - struct dirent **counterlist; > - int count, i; > - /* assume nothing is available */ > - u32 available=0; > - > - count = scandir("/dev/oprofile", &counterlist, perfcounterdir, > - alphasort); > - if (count < 0) > - /* unable to determine bit mask */ > - return -1; > - /* convert to bit map (0 where counter exists) */ > - for (i=0; i<count; ++i) { > - available |= 1 << atoi(counterlist[i]->d_name); > - free(counterlist[i]); > - } > - /* Append the timer counter to the mask of hardware counters. */ > - if (op_cpu_has_timer_fs()) { > - available |= 1 << (op_get_nr_counters(op_get_cpu_type()) - 1); > - count++; > - } > - *mask=~available; > - free(counterlist); > - return count; > -} > > size_t * map_event_to_counter(struct op_event const * pev[], int nr_events, > op_cpu cpu_type) > @@ -205,19 +164,9 @@ size_t * map_event_to_counter(struct op_event const * pev[], int nr_events, > counter_arc_head * ctr_arc; > size_t * counter_map; > int i, nr_counters, nr_pmc_events; > - op_cpu curr_cpu_type; > u32 unavailable_counters = 0; > > - /* Either ophelp or one of the libop tests may invoke this > - * function with a non-native cpu_type. If so, we should not > - * call op_get_counter_mask because that will look for real counter > - * information in oprofilefs. > - */ > - curr_cpu_type = op_get_cpu_type(); > - if (cpu_type != curr_cpu_type) > - nr_counters = op_get_nr_counters(cpu_type); > - else > - nr_counters = op_get_counter_mask(&unavailable_counters); > + nr_counters = op_get_nr_counters(cpu_type); > > /* no counters then probably perfmon managing perfmon hw */ > if (nr_counters <= 0) { > diff --git a/libop/op_config.c b/libop/op_config.c > index 95669ba..7dd0ec4 100644 > --- a/libop/op_config.c > +++ b/libop/op_config.c > @@ -68,15 +68,4 @@ init_op_config_dirs(char const * session_dir) > strcpy(op_samples_current_dir, op_samples_dir); > strcat(op_samples_current_dir, "/current/"); > > - strcpy(op_lock_file, op_session_dir); > - strcat(op_lock_file, "/lock"); > - > - strcpy(op_pipe_file, op_session_dir); > - strcat(op_pipe_file, "/opd_pipe"); > - > - strcpy(op_log_file, op_samples_dir); > - strcat(op_log_file, "oprofiled.log"); > - > - strcpy(op_dump_status, op_session_dir); > - strcat(op_dump_status, "/complete_dump"); > } > diff --git a/libop/op_config.h b/libop/op_config.h > index 8a5ef82..04102e6 100644 > --- a/libop/op_config.h > +++ b/libop/op_config.h > @@ -49,33 +49,9 @@ extern char * stats_filenames[]; > */ > void init_op_config_dirs(char const * session_dir); > > -//void init_op_stats_filenames(char const * session_dir); > - > #define OP_SESSION_DIR_DEFAULT "/var/lib/oprofile/" > > > -/*@{\name module default/min/max settings */ > - > -/** 65536 * sizeof(op_sample) */ > -#define OP_DEFAULT_BUF_SIZE 65536 > -/** > - * we don't try to wake-up daemon until it remains more than this free entry > - * in eviction buffer > - */ > -#define OP_PRE_WATERMARK(buffer_size) \ > - (((buffer_size) / 8) < OP_MIN_PRE_WATERMARK \ > - ? OP_MIN_PRE_WATERMARK \ > - : (buffer_size) / 8) > -/** minimal buffer water mark before we try to wakeup daemon */ > -#define OP_MIN_PRE_WATERMARK 8192 > -/** maximum number of entry in samples eviction buffer */ > -#define OP_MAX_BUF_SIZE 1048576 > -/** minimum number of entry in samples eviction buffer */ > -#define OP_MIN_BUF_SIZE (32768 + OP_PRE_WATERMARK(32768)) > - > -/** maximum sampling rate when using RTC */ > -#define OP_MAX_RTC_COUNT 4096 > - > /* > * various paths, corresponding to opcontrol, that should be > * initialized by init_op_config_dirs() above. > @@ -83,10 +59,6 @@ void init_op_config_dirs(char const * session_dir); > extern char op_session_dir[]; > extern char op_samples_dir[]; > extern char op_samples_current_dir[]; > -extern char op_lock_file[]; > -extern char op_log_file[]; > -extern char op_pipe_file[]; > -extern char op_dump_status[]; > > /* Global directory that stores debug files */ > #ifndef DEBUGDIR > @@ -96,9 +68,6 @@ extern char op_dump_status[]; > #define OPD_MAGIC "DAE\n" > #define OPD_VERSION 0x12 > > -#define OP_MIN_CPU_BUF_SIZE 2048 > -#define OP_MAX_CPU_BUF_SIZE 131072 > - > #if defined(__cplusplus) > } > #endif > diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c > index 94d832f..e2b9f35 100644 > --- a/libop/op_cpu_type.c > +++ b/libop/op_cpu_type.c > @@ -45,12 +45,8 @@ static struct cpu_descr const cpu_descrs[MAX_CPU_TYPE] = { > { "PII", "i386/pii", CPU_PII, 2 }, > { "PIII", "i386/piii", CPU_PIII, 2 }, > { "Athlon", "i386/athlon", CPU_ATHLON, 4 }, > - { "CPU with timer interrupt", "timer", CPU_TIMER_INT, 1 }, > - { "CPU with RTC device", "rtc", CPU_RTC, 1 }, > + { "CPU with timer interrupt", "timer", CPU_TIMER_INT, 1 }, > { "P4 / Xeon", "i386/p4", CPU_P4, 8 }, > - { "IA64", "ia64/ia64", CPU_IA64, 4 }, > - { "Itanium", "ia64/itanium", CPU_IA64_1, 4 }, > - { "Itanium 2", "ia64/itanium2", CPU_IA64_2, 4 }, > { "AMD64 processors", "x86-64/hammer", CPU_HAMMER, 4 }, > { "P4 / Xeon with 2 hyper-threads", "i386/p4-ht", CPU_P4_HT2, 4 }, > { "Alpha EV4", "alpha/ev4", CPU_AXP_EV4, 2 }, > @@ -84,19 +80,15 @@ static struct cpu_descr const cpu_descrs[MAX_CPU_TYPE] = { > { "Core 2", "i386/core_2", CPU_CORE_2, 2 }, > { "ppc64 POWER6", "ppc64/power6", CPU_PPC64_POWER6, 4 }, > { "ppc64 970MP", "ppc64/970MP", CPU_PPC64_970MP, 8 }, > - { "ppc64 Cell Broadband Engine", "ppc64/cell-be", CPU_PPC64_CELL, 8 }, > { "AMD64 family10", "x86-64/family10", CPU_FAMILY10, 4 }, > - { "ppc64 PA6T", "ppc64/pa6t", CPU_PPC64_PA6T, 6 }, > { "ARM 11MPCore", "arm/mpcore", CPU_ARM_MPCORE, 2 }, > { "ARM V6 PMU", "arm/armv6", CPU_ARM_V6, 3 }, > { "ppc64 POWER5++", "ppc64/power5++", CPU_PPC64_POWER5pp, 6 }, > { "e300", "ppc/e300", CPU_PPC_E300, 4 }, > - { "AVR32", "avr32", CPU_AVR32, 3 }, > { "ARM Cortex-A8", "arm/armv7", CPU_ARM_V7, 5 }, > { "Intel Architectural Perfmon", "i386/arch_perfmon", CPU_ARCH_PERFMON, 0}, > { "AMD64 family11h", "x86-64/family11h", CPU_FAMILY11H, 4 }, > { "ppc64 POWER7", "ppc64/power7", CPU_PPC64_POWER7, 6 }, > - { "ppc64 compat version 1", "ppc64/ibm-compat-v1", CPU_PPC64_IBM_COMPAT_V1, 4 }, > { "Intel Core/i7", "i386/core_i7", CPU_CORE_I7, 4 }, > { "Intel Atom", "i386/atom", CPU_ATOM, 2 }, > { "Loongson2", "mips/loongson2", CPU_MIPS_LOONGSON2, 2 }, > @@ -121,8 +113,7 @@ static struct cpu_descr const cpu_descrs[MAX_CPU_TYPE] = { > { "ARM Cortex-A7", "arm/armv7-ca7", CPU_ARM_V7_CA7, 5 }, > { "ARM Cortex-A15", "arm/armv7-ca15", CPU_ARM_V7_CA15, 7 }, > { "Intel Haswell microarchitecture", "i386/haswell", CPU_HASWELL, 4 }, > - { "IBM zEnterprise EC12", "s390/zEC12", CPU_S390_ZEC12, 1 }, > - { "AMD64 generic", "x86-64/generic", CPU_AMD64_GENERIC, 4 }, > + { "IBM zEnterprise EC12", "s390/zEC12", CPU_S390_ZEC12, 1 }, { "AMD64 generic", "x86-64/generic", CPU_AMD64_GENERIC, 4 }, > { "IBM Power Architected Events V1", "ppc64/architected_events_v1", CPU_PPC64_ARCH_V1, 6 }, > { "ppc64 POWER8", "ppc64/power8", CPU_PPC64_POWER8, 6 }, > { "e500mc", "ppc/e500mc", CPU_PPC_E500MC, 4 }, > @@ -662,7 +653,7 @@ static op_cpu _get_s390_cpu_type(void) > return CPU_NO_GOOD; > } > > -static op_cpu __get_cpu_type_alt_method(void) > +static op_cpu __get_cpu_type(void) > { > struct utsname uname_info; > if (uname(&uname_info) < 0) { > @@ -728,35 +719,11 @@ op_cpu op_cpu_base_type(op_cpu cpu_type) > op_cpu op_get_cpu_type(void) > { > int cpu_type = CPU_NO_GOOD; > - char str[100]; > - FILE * fp; > > - fp = fopen("/proc/sys/dev/oprofile/cpu_type", "r"); > - if (!fp) { > - /* Try 2.6's oprofilefs one instead. */ > - fp = fopen("/dev/oprofile/cpu_type", "r"); > - if (!fp) { > - if ((cpu_type = __get_cpu_type_alt_method()) == CPU_NO_GOOD) { > - fprintf(stderr, "Unable to open cpu_type file for reading\n"); > - fprintf(stderr, "Make sure you have done opcontrol --init\n"); > - } > - return cpu_type; > - } > + if ((cpu_type = __get_cpu_type()) == CPU_NO_GOOD) { > + fprintf(stderr, "Unable to open cpu_type file for reading\n"); > + fprintf(stderr, "Make sure you have done opcontrol --init\n"); > } > - > - if (!fgets(str, 99, fp)) { > - fprintf(stderr, "Could not read cpu type.\n"); > - fclose(fp); > - return cpu_type; > - } > - > - cpu_type = op_get_cpu_number(str); > - > - if (op_cpu_variations(cpu_type)) > - cpu_type = op_cpu_specific_type(cpu_type); > - > - fclose(fp); > - > return cpu_type; > } > > @@ -810,26 +777,8 @@ int op_get_nr_counters(op_cpu cpu_type) > return 0; > > cnt = arch_num_counters(cpu_type); > - if (cnt >= 0) > - return cnt; > - > - return op_cpu_has_timer_fs() > - ? cpu_descrs[cpu_type].nr_counters + 1 > - : cpu_descrs[cpu_type].nr_counters; > + if (cnt < 0) > + cnt = cpu_descrs[cpu_type].nr_counters; > + return cnt; > } > > -int op_cpu_has_timer_fs(void) > -{ > - static int cached_has_timer_fs_p = -1; > - FILE * fp; > - > - if (cached_has_timer_fs_p != -1) > - return cached_has_timer_fs_p; > - > - fp = fopen("/dev/oprofile/timer", "r"); > - cached_has_timer_fs_p = !!fp; > - if (fp) > - fclose(fp); > - > - return cached_has_timer_fs_p; > -} > diff --git a/libop/op_cpu_type.h b/libop/op_cpu_type.h > index a6bb323..a65918a 100644 > --- a/libop/op_cpu_type.h > +++ b/libop/op_cpu_type.h > @@ -25,12 +25,8 @@ typedef enum { > CPU_PII, /**< Pentium II series */ > CPU_PIII, /**< Pentium III series */ > CPU_ATHLON, /**< AMD P6 series */ > - CPU_TIMER_INT, /**< CPU using the timer interrupt */ > - CPU_RTC, /**< other CPU to use the RTC */ > + CPU_TIMER_INT, /**< CPU using the timer interrupt */ > CPU_P4, /**< Pentium 4 / Xeon series */ > - CPU_IA64, /**< Generic IA64 */ > - CPU_IA64_1, /**< IA64 Merced */ > - CPU_IA64_2, /**< IA64 McKinley */ > CPU_HAMMER, /**< AMD Hammer family */ > CPU_P4_HT2, /**< Pentium 4 / Xeon series with 2 hyper-threads */ > CPU_AXP_EV4, /**< Alpha EV4 family */ > @@ -64,19 +60,15 @@ typedef enum { > CPU_CORE_2, /**< Intel Core 2 */ > CPU_PPC64_POWER6, /**< ppc64 POWER6 family */ > CPU_PPC64_970MP, /**< ppc64 970MP */ > - CPU_PPC64_CELL, /**< ppc64 Cell Broadband Engine*/ > CPU_FAMILY10, /**< AMD family 10 */ > - CPU_PPC64_PA6T, /**< ppc64 PA6T */ > CPU_ARM_MPCORE, /**< ARM MPCore */ > CPU_ARM_V6, /**< ARM V6 */ > CPU_PPC64_POWER5pp, /**< ppc64 Power5++ family */ > CPU_PPC_E300, /**< e300 */ > - CPU_AVR32, /**< AVR32 */ > CPU_ARM_V7, /**< ARM Cortex-A8 */ > CPU_ARCH_PERFMON, /**< Intel architectural perfmon */ > CPU_FAMILY11H, /**< AMD family 11h */ > CPU_PPC64_POWER7, /**< ppc64 POWER7 family */ > - CPU_PPC64_IBM_COMPAT_V1, /**< IBM PPC64 processor compat mode version 1 */ > CPU_CORE_I7, /* Intel Core i7, Nehalem */ > CPU_ATOM, /* First generation Intel Atom */ > CPU_MIPS_LOONGSON2, /* < loongson2 family */ > @@ -101,8 +93,7 @@ typedef enum { > CPU_ARM_V7_CA7, /**< ARM Cortex-A7 */ > CPU_ARM_V7_CA15, /**< ARM Cortex-A15 */ > CPU_HASWELL, /** < Intel Haswell microarchitecture */ > - CPU_S390_ZEC12, /**< IBM zEnterprise EC12 */ > - CPU_AMD64_GENERIC, /**< AMD64 Generic */ > + CPU_S390_ZEC12, /**< IBM zEnterprise EC12 */ CPU_AMD64_GENERIC, /**< AMD64 Generic */ > CPU_PPC64_ARCH_V1, /** < IBM Power architected events version 1 */ > CPU_PPC64_POWER8, /**< ppc64 POWER8 family */ > CPU_PPC_E500MC, /**< e500mc */ > @@ -176,28 +167,6 @@ int op_is_cpu_vendor(char * vendor); > */ > int op_get_nr_counters(op_cpu cpu_type); > > -typedef enum { > - OP_INTERFACE_NO_GOOD = -1, > - OP_INTERFACE_26 > -} op_interface; > - > -/** > - * get the INTERFACE used to communicate between daemon and the kernel > - * > - * returns OP_INTERFACE_NO_GOOD if the INTERFACE could not be identified. > - * This function will identify the interface as OP_INTERFACE_NO_GOOD if > - * the module is not loaded. > - */ > -op_interface op_get_interface(void); > - > -/** > - * determine if the /dev/oprofile/timer is available > - * > - * return true if the kernel modules provides the /dev/oprofile > - * interface for timer mode sampling. > - */ > -int op_cpu_has_timer_fs(void); > - > #ifdef __cplusplus > } > #endif > diff --git a/libop/op_events.c b/libop/op_events.c > index bbeb212..6507da0 100644 > --- a/libop/op_events.c > +++ b/libop/op_events.c > @@ -683,8 +683,6 @@ static void load_events(op_cpu cpu_type) > { > const char * cpu_name = op_get_cpu_name(cpu_type); > struct list_head * pos; > - struct op_event *event; > - struct op_unit_mask *unit_mask; > int err = 0; > > if (!list_empty(&events_list)) > @@ -702,57 +700,6 @@ static void load_events(op_cpu cpu_type) > if (err) > exit(err); > > - if (!op_cpu_has_timer_fs()) > - return; > - > - /* sanity check: Don't use event `TIMER' since it is predefined. */ > - list_for_each(pos, &events_list) { > - struct op_event * event = list_entry(pos, struct op_event, > - event_next); > - > - if (strcmp(event->name, TIMER_EVENT_NAME) == 0) { > - fprintf(stderr, "Error: " TIMER_EVENT_NAME > - " event cannot be redefined.\n"); > - exit(EXIT_FAILURE); > - } > - if (event->val == TIMER_EVENT_VALUE) { > - fprintf(stderr, "Error: Event %s uses " TIMER_EVENT_NAME > - " which is reserverd for timer based sampling.\n", > - event->name); > - exit(EXIT_FAILURE); > - } > - } > - > - list_for_each(pos, &um_list) { > - struct op_unit_mask * um = list_entry(pos, struct op_unit_mask, > - um_next); > - if (strcmp(um->name, TIMER_EVENT_UNIT_MASK_NAME) == 0) { > - fprintf(stderr, "Error: " TIMER_EVENT_UNIT_MASK_NAME > - " unit mask cannot be redefined.\n"); > - exit(EXIT_FAILURE); > - } > - } > - > - unit_mask = new_unit_mask(); > - unit_mask->name = xstrdup(TIMER_EVENT_UNIT_MASK_NAME); > - unit_mask->num = 1; > - unit_mask->unit_type_mask = utm_mandatory; > - unit_mask->um[0].extra = 0; > - unit_mask->um[0].value = 0; > - unit_mask->um[0].name = xstrdup(""); > - unit_mask->um[0].desc = xstrdup("No unit mask"); > - unit_mask->used = 1; > - > - event = new_event(); > - event->name = xstrdup(TIMER_EVENT_NAME); > - event->desc = xstrdup(TIMER_EVENT_DESC); > - event->val = TIMER_EVENT_VALUE; > - event->unit = unit_mask; > - event->min_count = 0; > - event->filter = 0; > - event->counter_mask = 1 << (op_get_nr_counters(cpu_type) - 1); > - event->ext = NULL; > - event->filter = -1; > } > > struct list_head * op_events(op_cpu cpu_type) > @@ -948,7 +895,6 @@ char const * find_mapping_for_event(u32 nr, op_cpu cpu_type) > FILE * fp = open_event_mapping_file(cpu_name); > char const * map = NULL; > switch (cpu_type) { > - case CPU_PPC64_PA6T: > case CPU_PPC64_970: > case CPU_PPC64_970MP: > case CPU_PPC64_POWER4: > @@ -957,7 +903,6 @@ char const * find_mapping_for_event(u32 nr, op_cpu cpu_type) > case CPU_PPC64_POWER5pp: > case CPU_PPC64_POWER6: > case CPU_PPC64_POWER7: > - case CPU_PPC64_IBM_COMPAT_V1: > // For ppc64 types of CPU_PPC64_ARCH_V1 and higher, we don't need an event_mappings file > if (!fp) { > fprintf(stderr, "oprofile: could not open event mapping file %s\n", filename); > @@ -1214,24 +1159,12 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr) > descr->name = "CPU_CLK_UNHALTED"; > break; > > - case CPU_RTC: > - descr->name = "RTC_INTERRUPTS"; > - descr->count = 1024; > - break; > - > case CPU_P4: > case CPU_P4_HT2: > descr->name = "GLOBAL_POWER_EVENTS"; > descr->um = 0x1; > break; > > - case CPU_IA64: > - case CPU_IA64_1: > - case CPU_IA64_2: > - descr->count = 1000000; > - descr->name = "CPU_CYCLES"; > - break; > - > case CPU_AXP_EV4: > case CPU_AXP_EV5: > case CPU_AXP_PCA56: > @@ -1250,7 +1183,6 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr) > case CPU_ARM_V7_CA7: > case CPU_ARM_V7_CA9: > case CPU_ARM_V7_CA15: > - case CPU_AVR32: > case CPU_ARM_SCORPION: > case CPU_ARM_SCORPIONMP: > case CPU_ARM_KRAIT: > @@ -1260,7 +1192,6 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr) > descr->name = "CPU_CYCLES"; > break; > > - case CPU_PPC64_PA6T: > case CPU_PPC64_970: > case CPU_PPC64_970MP: > case CPU_PPC_7450: > @@ -1269,9 +1200,7 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr) > case CPU_PPC64_POWER6: > case CPU_PPC64_POWER5p: > case CPU_PPC64_POWER5pp: > - case CPU_PPC64_CELL: > case CPU_PPC64_POWER7: > - case CPU_PPC64_IBM_COMPAT_V1: > case CPU_PPC64_ARCH_V1: > case CPU_PPC64_POWER8: > descr->name = "CYCLES"; > @@ -1323,14 +1252,9 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr) > case CPU_S390_Z10: > case CPU_S390_Z196: > case CPU_S390_ZEC12: > - if (op_get_nr_counters(cpu_type) > 1) { > - descr->name = "HWSAMPLING"; > - descr->count = 4127518; > - } else { > - descr->name = TIMER_EVENT_NAME; > - descr->count = 10000; > - } > - break; > + descr->name = "HWSAMPLING"; > + descr->count = 4127518; > + break; > > case CPU_TILE_TILE64: > case CPU_TILE_TILEPRO: > diff --git a/libop/op_events.h b/libop/op_events.h > index 1671bf1..be609f7 100644 > --- a/libop/op_events.h > +++ b/libop/op_events.h > @@ -30,16 +30,6 @@ extern "C" { > #define EXTRA_PEBS (1U << 19) /* fake, mapped to pin control, but mapped back for perf */ > #define EXTRA_NONE (1U << 22) /* mapped to enabled */ > > -/* > - * For timer based sampling some targets (e.g. s390) use a virtual > - * counter whose file system resides in /dev/oprofile/timer. These > - * macros set the values used to define a specific timer event solely > - * used by the timer counter. > - */ > -#define TIMER_EVENT_NAME "TIMER" > -#define TIMER_EVENT_UNIT_MASK_NAME "timer_unit_mask" > -#define TIMER_EVENT_DESC "Timer based sampling" > -#define TIMER_EVENT_VALUE (u32)-1 > > /** Describe an unit mask type. Events can optionally use a filter called > * the unit mask. the mask type can be a bitmask or a discrete value */ > diff --git a/libop/op_get_interface.c b/libop/op_get_interface.c > deleted file mode 100644 > index 79f1af3..0000000 > --- a/libop/op_get_interface.c > +++ /dev/null > @@ -1,29 +0,0 @@ > -/** > - * @file op_get_interface.c > - * Determine which oprofile kernel interface used > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author Will Cohen > - */ > - > -#include <stdio.h> > -#include <stdlib.h> > -#include <string.h> > - > -#include "op_cpu_type.h" > -#include "op_file.h" > - > -op_interface op_get_interface(void) > -{ > - static op_interface current_interface = OP_INTERFACE_NO_GOOD; > - > - if (current_interface != OP_INTERFACE_NO_GOOD) > - return current_interface; > - > - if (op_file_readable("/dev/oprofile/cpu_type")) > - current_interface = OP_INTERFACE_26; > - > - return current_interface; > -} > diff --git a/libop/op_interface.h b/libop/op_interface.h > deleted file mode 100644 > index fa2ecbd..0000000 > --- a/libop/op_interface.h > +++ /dev/null > @@ -1,87 +0,0 @@ > -/** > - * @file op_interface.h > - * > - * Module / user space interface for 2.4 > - * > - * @remark Copyright 2002 OProfile authors > - * @remark Read the file COPYING > - * > - * @author John Levon > - * @author Philippe Elie > - */ > - > -#ifndef OP_INTERFACE_H > -#define OP_INTERFACE_H > - > -#include "op_config.h" > -#include "op_types.h" > - > -/*@{\name notifications types encoded in op_note::type */ > -/** fork(),vfork(),clone() */ > -#define OP_FORK 1 > -/** mapping */ > -#define OP_MAP 2 > -/** execve() */ > -#define OP_EXEC 4 > -/** init_module() */ > -#define OP_DROP_MODULES 8 > -/** exit() */ > -#define OP_EXIT 16 > -/*@}*/ > - > -/** Data type to transfer samples counts from the module to the daemon */ > -struct op_sample { > - unsigned long eip; /**< eip value where occur interrupt */ > - u32 counter; /**< counter nr */ > - u32 pid; /**< 32 bits can hold any pid */ > - u32 tgid; /**< always equal to pid for kernel < 2.4.0 */ > -}; > - > -/** the current kernel-side profiler state */ > -enum oprof_state { > - STOPPED = 0, > - STOPPING = 1, > - RUNNING = 2 > -}; > - > -/** > - * The head structure of a kernel sample buffer. > - */ > -struct op_buffer_head { > - int cpu_nr; /**< the CPU number of this buffer */ > - size_t count; /**< number of samples in this buffer */ > - enum oprof_state state; /**< current profiler state */ > - struct op_sample buffer[0]; /**< the sample buffer */ > -} __attribute__((__packed__)); > - > -/** > - * Data type used by the module to notify daemon of fork/exit/mapping etc. > - * Meanings of fields depend on the type of notification encoded in the type > - * field. > - * \sa OP_FORK, OP_EXEC, OP_MAP, OP_DROP_MODULES and OP_EXIT > - */ > -struct op_note { > - unsigned long addr; > - unsigned long len; > - unsigned long offset; > - unsigned int hash; > - unsigned int pid; > - unsigned int tgid; > - unsigned short type; > -}; > - > -/** > - * A path component. Directory name are stored as a stack of path components. > - * Note than the name index acts also as an unique identifier > - */ > -struct op_hash_index { > - /** index inside the string pool */ > - u32 name; > - /** parent component, zero if this component is the root */ > - u32 parent; > -} __attribute__((__packed__)); > - > -/** size of hash map in bytes */ > -#define OP_HASH_MAP_SIZE (OP_HASH_MAP_NR * sizeof(struct op_hash_index) + POOL_SIZE) > - > -#endif /* OP_INTERFACE_H */ > diff --git a/libop/op_parse_event.c b/libop/op_parse_event.c > index 722bd3b..a42966b 100644 > --- a/libop/op_parse_event.c > +++ b/libop/op_parse_event.c > @@ -62,7 +62,6 @@ size_t parse_events(struct parsed_event * parsed_events, size_t max_events, > char const * const * events, int check_count) > { > size_t i = 0; > - int timer_event_found_p = 0; > > while (events[i]) { > char const * cp = events[i]; > @@ -80,9 +79,6 @@ size_t parse_events(struct parsed_event * parsed_events, size_t max_events, > exit(EXIT_FAILURE); > } > > - if (strcmp(part, TIMER_EVENT_NAME) == 0) > - timer_event_found_p = 1; > - > parsed_events[i].name = part; > > if (check_count) { > @@ -127,12 +123,5 @@ size_t parse_events(struct parsed_event * parsed_events, size_t max_events, > > ++i; > } > - > - if (i > 1 && timer_event_found_p) { > - fprintf(stderr, "TIMER event cannot be used in combination with" > - " hardware counters.\n"); > - exit(EXIT_FAILURE); > - } > - > return i; > } > diff --git a/libop/op_xml_events.c b/libop/op_xml_events.c > index c301732..ed1dce2 100644 > --- a/libop/op_xml_events.c > +++ b/libop/op_xml_events.c > @@ -42,20 +42,6 @@ void close_xml_events(void) > printf("%s", buffer); > } > > -static void xml_do_arch_specific_event_help(struct op_event const *event, > - char *buffer, size_t size) > -{ > - switch (cpu_type) { > - case CPU_PPC64_CELL: > - init_xml_int_attr(HELP_EVENT_GROUP, event->val / 100, buffer, > - size); > - break; > - default: > - break; > - } > -} > - > - > void xml_help_for_event(struct op_event const * event) > { > uint i; > @@ -64,7 +50,6 @@ void xml_help_for_event(struct op_event const * event) > buffer[0] = '\0'; > open_xml_element(HELP_EVENT, 1, buffer, MAX_BUFFER); > init_xml_str_attr(HELP_EVENT_NAME, event->name, buffer, MAX_BUFFER); > - xml_do_arch_specific_event_help(event, buffer, MAX_BUFFER); > init_xml_str_attr(HELP_EVENT_DESC, event->desc, buffer, MAX_BUFFER); > > init_xml_int_attr(HELP_COUNTER_MASK, event->counter_mask, buffer, > diff --git a/libop/tests/cpu_type_tests.c b/libop/tests/cpu_type_tests.c > index 3cbde5e..beb0dee 100644 > --- a/libop/tests/cpu_type_tests.c > +++ b/libop/tests/cpu_type_tests.c > @@ -24,11 +24,7 @@ static struct cpu_type { > { "i386/piii", CPU_PIII }, > { "i386/athlon", CPU_ATHLON }, > { "timer", CPU_TIMER_INT }, > - { "rtc", CPU_RTC }, > { "i386/p4", CPU_P4 }, > - { "ia64/ia64", CPU_IA64 }, > - { "ia64/itanium", CPU_IA64_1 }, > - { "ia64/itanium2", CPU_IA64_2 }, > { "x86-64/hammer", CPU_HAMMER }, > { "i386/p4-ht", CPU_P4_HT2 }, > { "alpha/ev4", CPU_AXP_EV4 }, > diff --git a/libpp/op_header.cpp b/libpp/op_header.cpp > index 9aba04b..29801fd 100644 > --- a/libpp/op_header.cpp > +++ b/libpp/op_header.cpp > @@ -194,17 +194,15 @@ string const op_print_event(op_cpu cpu_type, u32 type, u32 um, u32 count) > str += string("Counted ") + event->name; > str += string(" events (") + event->desc + ")"; > > - if (cpu_type != CPU_RTC) { > - str += " with a unit mask of 0x"; > + str += " with a unit mask of 0x"; > > - ostringstream ss; > - ss << hex << setw(2) << setfill('0') << unsigned(um); > - str += ss.str(); > + ostringstream ss; > + ss << hex << setw(2) << setfill('0') << unsigned(um); > + str += ss.str(); > > - str += " ("; > - str += um_desc ? um_desc : "multiple flags"; > - str += ")"; > - } > + str += " ("; > + str += um_desc ? um_desc : "multiple flags"; > + str += ")"; > > str += " count " + op_lexical_cast<string>(count); > return str; > @@ -214,7 +212,7 @@ string const op_xml_print_event(op_cpu cpu_type, u32 type, u32 um, u32 count) > { > string unit_mask; > > - if (cpu_type == CPU_TIMER_INT || cpu_type == CPU_RTC) > + if (cpu_type == CPU_TIMER_INT) > return xml_utils::get_timer_setup((size_t)count); > > struct op_event * event = op_find_event(cpu_type, type, um); > @@ -226,11 +224,9 @@ string const op_xml_print_event(op_cpu cpu_type, u32 type, u32 um, u32 count) > } > } > > - if (cpu_type != CPU_RTC) { > - ostringstream str_out; > - str_out << um; > - unit_mask = str_out.str(); > - } > + ostringstream str_out; > + str_out << um; > + unit_mask = str_out.str(); > > return xml_utils::get_event_setup(string(event->name), > (size_t)count, unit_mask); > diff --git a/libpp/profile_spec.cpp b/libpp/profile_spec.cpp > index 296df0a..b58df95 100644 > --- a/libpp/profile_spec.cpp > +++ b/libpp/profile_spec.cpp > @@ -616,9 +616,8 @@ list<string> profile_spec::generate_file_list(bool exclude_dependent, > > if (!found_file) { > ostringstream os; > - os << "No sample file found: If using opcontrol for profiling,\n" > - << "try running 'opcontrol --dump'; otherwise, specify a session containing\n" > - << "sample files.\n"; > + os << "No sample found: Please specify a session containing \n" > + << "sample data.\n"; > throw op_fatal_error(os.str()); > } > > diff --git a/m4/Makefile.am b/m4/Makefile.am > index 482fe2a..a6828ba 100644 > --- a/m4/Makefile.am > +++ b/m4/Makefile.am > @@ -11,7 +11,6 @@ EXTRA_DIST = \ > mallocattribute.m4 \ > poptconst.m4 \ > precompiledheader.m4 \ > - qt.m4 \ > resultyn.m4 \ > sstream.m4 \ > typedef.m4 > diff --git a/m4/cellspubfdsupport.m4 b/m4/cellspubfdsupport.m4 > deleted file mode 100644 > index e04ee87..0000000 > --- a/m4/cellspubfdsupport.m4 > +++ /dev/null > @@ -1,52 +0,0 @@ > -dnl AX_CELL_SPU - check for needed binutils stuff for Cell BE SPU > -AC_DEFUN([AX_CELL_SPU], > -[ > -# On Cell BE architecture, OProfile uses bfd_openr_iovec when processing some > -# SPU profiles. To parse embedded SPU ELF on Cell BE, OProfile requires a > -# version of bfd_openr_iovec that supports the elf32-spu target. > -# This version of the function also has a 7th parameter that's been added. > -# First, we check for existence of the base bfd_openr_iovec. If it exists, > -# we then use a temporary test program below that passes 7 arguments to > -# bfd_openr_iovec; if it compiles OK, we assume we have the right BFD > -# library to support Cell BE SPU profiling. > - > -AC_LANG_PUSH(C) > - > -AC_CHECK_LIB(bfd, bfd_openr_iovec, > - [bfd_openr_iovec_exists="yes"], > - [bfd_openr_iovec_exists="no"] > -) > - > -if test "$bfd_openr_iovec_exists" = "yes"; then > - AC_MSG_CHECKING([whether bfd_openr_iovec has seven parameters]) > - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <bfd.h> > - #include <stdlib.h> > - ], > - [[struct bfd *nbfd = bfd_openr_iovec("some-file", "elf32-spu", > - NULL, NULL, NULL, NULL, NULL); > - return 0; > - ]])], > - [AC_DEFINE([HAVE_BFD_OPENR_IOVEC_WITH_7PARMS], > - [], > - [Defined if you have the version of bfd_openr_iovec with 7 parameters]) > - bfd_open_iovec_7="yes" > - AC_MSG_RESULT([yes])], > - [AC_MSG_RESULT([no])] > - ) > -fi > - > -AC_LANG_POP(C) > - > -arch="unknown" > -AC_ARG_WITH(target, > -[ --with-target=cell-be Check BFD support for Cell Broadband Engine SPU profiling], arch=$withval) > - > -if test "$arch" = "cell-be"; then > - if test "$bfd_open_iovec_7" = "yes"; then > - AC_MSG_NOTICE([BFD library has support for Cell Broadband Engine SPU profiling]) > - else > - AC_ERROR([BFD library does not support elf32-spu target; SPU profiling is unsupported]) > - fi > -fi > -] > -) > diff --git a/m4/qt.m4 b/m4/qt.m4 > deleted file mode 100644 > index 48fd6e2..0000000 > --- a/m4/qt.m4 > +++ /dev/null > @@ -1,225 +0,0 @@ > -dnl find a binary in the path > -AC_DEFUN([QT_FIND_PATH], > -[ > - AC_MSG_CHECKING([for $1]) > - AC_CACHE_VAL(qt_cv_path_$1, > - [ > - qt_cv_path_$1="NONE" > - if test -n "$$2"; then > - qt_cv_path_$1="$$2"; > - else > - dirs="$3" > - qt_save_IFS=$IFS > - IFS=':' > - for dir in $PATH; do > - dirs="$dirs $dir" > - done > - IFS=$qt_save_IFS > - > - for dir in $dirs; do > - if test -x "$dir/$1"; then > - if test -n "$5"; then > - evalstr="$dir/$1 $5 2>&1 " > - if eval $evalstr; then > - qt_cv_path_$1="$dir/$1" > - break > - fi > - else > - qt_cv_path_$1="$dir/$1" > - break > - fi > - fi > - done > - fi > - ]) > - > - if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then > - AC_MSG_RESULT(not found) > - $4 > - else > - AC_MSG_RESULT($qt_cv_path_$1) > - $2=$qt_cv_path_$1 > - fi > -]) > - > -dnl Find the uic compiler on the path or in qt_cv_dir > -AC_DEFUN([QT_FIND_UIC], > -[ > - QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin) > - if test -z "$ac_uic" -a "$FATAL" = 1; then > - AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !]) > - fi > -]) > - > -dnl Find the right moc in path/qt_cv_dir > -AC_DEFUN([QT_FIND_MOC], > -[ > - QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin) > - QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin) > - > - if test -n "$ac_moc1" -a -n "$ac_moc2"; then > - dnl found both. Prefer Qt3's if it exists else moc2 > - $ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null > - if test "$?" = 0; then > - ac_moc=$ac_moc1; > - else > - ac_moc=$ac_moc2; > - fi > - else > - if test -n "$ac_moc1"; then > - ac_moc=$ac_moc1; > - else > - ac_moc=$ac_moc2; > - fi > - fi > - > - if test -z "$ac_moc" -a "$FATAL" = 1; then > - AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !]) > - fi > -]) > - > -dnl check a particular libname > -AC_DEFUN([QT_TRY_LINK], > -[ > - SAVE_LIBS="$LIBS" > - LIBS="$LIBS $1" > - AC_TRY_LINK([ > - #include <qglobal.h> > - #include <qstring.h> > - ], > - [ > - QString s("mangle_failure"); > - #if (QT_VERSION < 221) > - break_me_(\\\); > - #endif > - ], > - qt_cv_libname=$1, > - ) > - LIBS="$SAVE_LIBS" > -]) > - > -dnl check we can do a compile > -AC_DEFUN([QT_CHECK_COMPILE], > -[ > - AC_MSG_CHECKING([$1 for Qt library name]) > - > - AC_CACHE_VAL(qt_cv_libname, > - [ > - AC_LANG_CPLUSPLUS > - SAVE_CXXFLAGS=$CXXFLAGS > - CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS" > - > - for libname in -lqt-mt -lqt3 -lqt2 -lqt; > - do > - QT_TRY_LINK($libname) > - if test -n "$qt_cv_libname"; then > - break; > - fi > - done > - > - CXXFLAGS=$SAVE_CXXFLAGS > - ]) > - > - if test -z "$qt_cv_libname"; then > - AC_MSG_RESULT([failed]) > - if test "$FATAL" = 1 ; then > - AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !]) > - fi > - else > - AC_MSG_RESULT([$qt_cv_libname]) > - fi > -]) > - > -dnl get Qt version we're using > -AC_DEFUN([QT_GET_VERSION], > -[ > - AC_CACHE_CHECK([Qt version],lyx_cv_qtversion, > - [ > - AC_LANG_CPLUSPLUS > - SAVE_CPPFLAGS=$CPPFLAGS > - CPPFLAGS="$CPPFLAGS $QT_INCLUDES" > - > - cat > conftest.$ac_ext <<EOF > -#line __oline__ "configure" > -#include "confdefs.h" > -#include <qglobal.h> > -"%%%"QT_VERSION_STR"%%%" > -EOF > - lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \ > - grep '^"%%%"' 2>/dev/null | \ > - sed -e 's/"%%%"//g' -e 's/"//g'` > - rm -f conftest.$ac_ext > - CPPFLAGS=$SAVE_CPPFLAGS > - ]) > - > - QT_VERSION=$lyx_cv_qtversion > - AC_SUBST(QT_VERSION) > -]) > - > -dnl start here > -AC_DEFUN([QT_DO_IT_ALL], > -[ > - dnl Please leave this alone. I use this file in > - dnl oprofile. > - FATAL=0 > - > - AC_ARG_WITH(qt-dir, [ --with-qt-dir where the root of Qt is installed ], > - [ qt_cv_dir=`eval echo "$withval"/` ]) > - > - AC_ARG_WITH(qt-includes, [ --with-qt-includes where the Qt includes are. ], > - [ qt_cv_includes=`eval echo "$withval"` ]) > - > - AC_ARG_WITH(qt-libraries, [ --with-qt-libraries where the Qt library is installed.], > - [ qt_cv_libraries=`eval echo "$withval"` ]) > - > - dnl pay attention to $QTDIR unless overridden > - if test -z "$qt_cv_dir"; then > - qt_cv_dir=$QTDIR > - fi > - > - dnl derive inc/lib if needed > - if test -n "$qt_cv_dir"; then > - if test -z "$qt_cv_includes"; then > - qt_cv_includes=$qt_cv_dir/include > - fi > - if test -z "$qt_cv_libraries"; then > - qt_cv_libraries=$qt_cv_dir/lib > - fi > - fi > - > - dnl flags for compilation > - QT_INCLUDES= > - QT_LDFLAGS= > - if test -n "$qt_cv_includes"; then > - QT_INCLUDES="-isystem $qt_cv_includes" > - fi > - if test -n "$qt_cv_libraries"; then > - QT_LDFLAGS="-L$qt_cv_libraries" > - fi > - AC_SUBST(QT_INCLUDES) > - AC_SUBST(QT_LDFLAGS) > - > - QT_FIND_MOC > - MOC=$ac_moc > - AC_SUBST(MOC) > - QT_FIND_UIC > - UIC=$ac_uic > - AC_SUBST(UIC) > - > - QT_CHECK_COMPILE(in lib) > - if test -z "$qt_cv_libname"; then > - if test -n "$qt_cv_dir"; then > - dnl Try again using lib64 vs lib > - qt_cv_libraries=$qt_cv_dir/lib64 > - QT_LDFLAGS="-L$qt_cv_libraries" > - QT_CHECK_COMPILE(in lib64) > - fi > - fi > - > - QT_LIB=$qt_cv_libname; > - AC_SUBST(QT_LIB) > - > - if test -n "$qt_cv_libname"; then > - QT_GET_VERSION > - fi > -]) > diff --git a/opjitconv/create_bfd.c b/opjitconv/create_bfd.c > index b2ce360..48db143 100644 > --- a/opjitconv/create_bfd.c > +++ b/opjitconv/create_bfd.c > @@ -15,7 +15,6 @@ > */ > > #include "opjitconv.h" > -#include "opd_printf.h" > #include "op_libiberty.h" > > #include <bfd.h> > diff --git a/opjitconv/jitsymbol.c b/opjitconv/jitsymbol.c > index 8fe4ec7..e2b1e66 100644 > --- a/opjitconv/jitsymbol.c > +++ b/opjitconv/jitsymbol.c > @@ -15,7 +15,6 @@ > */ > > #include "opjitconv.h" > -#include "opd_printf.h" > #include "op_libiberty.h" > #include "op_types.h" > > diff --git a/opjitconv/opjitconv.c b/opjitconv/opjitconv.c > index 3314c5c..fb38fb3 100644 > --- a/opjitconv/opjitconv.c > +++ b/opjitconv/opjitconv.c > @@ -15,7 +15,6 @@ > */ > > #include "opjitconv.h" > -#include "opd_printf.h" > #include "op_file.h" > #include "op_libiberty.h" > > @@ -362,10 +361,8 @@ chk_proc_id: > goto out; > } > if (!(anon_dir = find_anon_dir_match(anon_sample_dirs, proc_id))) { > - /* With the capability of profiling with operf (as well as with > - * the legacy oprofile daemon), users will not be using opcontrol > - * to remove all jitdump files; instead, opjitconv will remove old > - * jitdump files (see _cleanup_jitdumps() for details). But this cleanup > + /* When profiling with operf, opjitconv will remove old jitdump > + * files (see _cleanup_jitdumps() for details). But this cleanup > * strategy makes it quite likely that opjitconv will sometimes find > * jitdump files that are not owned by the current user or are in use > * by other operf users, thus, the current profile data would not have > diff --git a/opjitconv/opjitconv.h b/opjitconv/opjitconv.h > index a3ce37f..ff87d74 100644 > --- a/opjitconv/opjitconv.h > +++ b/opjitconv/opjitconv.h > @@ -34,6 +34,14 @@ > #include "op_list.h" > #include "op_types.h" > > +#define verbprintf(x, args...) \ > + do { \ > + /* This is a bit fragile, but we must catch verbprintf("%s", "") */ \ > + if (x == 1) \ > + printf(args); \ > + } while (0) > + > + > /* Structure that contains all information > * for one function entry in the jit dump file. > * the jit dump file gets mmapped and code and > diff --git a/opjitconv/parse_dump.c b/opjitconv/parse_dump.c > index 2625c7c..f50807e 100644 > --- a/opjitconv/parse_dump.c > +++ b/opjitconv/parse_dump.c > @@ -16,7 +16,6 @@ > > #include "opjitconv.h" > #include "jitdump.h" > -#include "opd_printf.h" > #include "op_libiberty.h" > > #include <string.h> > diff --git a/pe_counting/ocount.cpp b/pe_counting/ocount.cpp > index 9647a0d..d8f23b8 100644 > --- a/pe_counting/ocount.cpp > +++ b/pe_counting/ocount.cpp > @@ -836,7 +836,10 @@ int main(int argc, char * const argv[]) > } > } > if (rc == EBUSY) > - cerr << "Performance monitor unit is busy. Do 'opcontrol --deinit' and try again." << endl; > + cerr << "Performance monitor unit is busy. Ensure that no other profilers are running on the system." << endl > + << "Note: For example, the obsolete opcontrol profiler (available in earlier oprofile releases)" << endl > + << "does not allow other performance tools to run simultaneously. To check for this, look for the" << endl > + << "'oprofiled' process using the 'ps' command." << endl; > else if (rc == ENOSYS) > cerr << "Your kernel does not implement a required syscall" > << " for the ocount program." << endl; > @@ -858,9 +861,10 @@ int main(int argc, char * const argv[]) > } > > if (cpu_type == CPU_TIMER_INT) { > - cerr << "CPU type 'timer' was detected, but ocount does not support timer mode." << endl > - << "Ensure the oprofile kernel module is unloaded ('opcontrol --deinit');" << endl > - << "then try running ocount again." << endl; > + cerr << "CPU type 'timer' was detected, but ocount does not support 'timer' as a cpu type." << endl > + << "Ensure the obsolete opcontrol profiler (available in earlier oprofile releases)" << endl > + << "is not running on the system. To check for this, look for the 'oprofiled'" << endl > + << "process using the 'ps' command." << endl; > cleanup(); > exit(1); > } > diff --git a/pe_profiling/operf.cpp b/pe_profiling/operf.cpp > index 51f55a5..6d7b9ed 100644 > --- a/pe_profiling/operf.cpp > +++ b/pe_profiling/operf.cpp > @@ -1490,7 +1490,10 @@ int main(int argc, char * const argv[]) > } > } > if (rc == EBUSY) { > - cerr << "Performance monitor unit is busy. Do 'opcontrol --deinit' and try again." << endl; > + cerr << "Performance monitor unit is busy. Ensure that no other profilers are running on the system." << endl > + << "Note: For example, the obsolete opcontrol profiler (available in earlier oprofile releases)" << endl > + << "does not allow other perforrmance tools to run simultaneously. To check for this, look for the" << endl > + << "'oprofiled' process using the 'ps' command." << endl; > exit(1); > } > if (rc == ENOSYS) { > @@ -1516,8 +1519,9 @@ int main(int argc, char * const argv[]) > > if (cpu_type == CPU_TIMER_INT) { > cerr << "CPU type 'timer' was detected, but operf does not support timer mode." << endl > - << "Ensure the oprofile kernel module is unloaded ('opcontrol --deinit');" << endl > - << "then try running operf again." << endl; > + << "Ensure the obsolete opcontrol profiler (available in earlier oprofile releases)" << endl > + << "is not running on the system. To check for this, look for the 'oprofiled'" << endl > + << "process using the 'ps' command." << endl; > cleanup(); > exit(1); > } > diff --git a/pp/common_option.cpp b/pp/common_option.cpp > index eaf5c75..e1499ad 100644 > --- a/pp/common_option.cpp > +++ b/pp/common_option.cpp > @@ -187,7 +187,7 @@ options::spec get_options(int argc, char const * argv[]) > if ((stat(options::session_dir.c_str(), &sb) < 0) || > ((sb.st_mode & S_IFMT) != S_IFDIR)) { > // Use the standard default session dir instead > - options::session_dir = "/var/lib/oprofile"; > + options::session_dir = OP_SESSION_DIR_DEFAULT; > } > session_dir_supplied = 0; > } else { > diff --git a/pp/oparchive_options.cpp b/pp/oparchive_options.cpp > index 18f74f3..e6f2ddc 100644 > --- a/pp/oparchive_options.cpp > +++ b/pp/oparchive_options.cpp > @@ -122,9 +122,9 @@ void handle_options(options::spec const & spec) > exit(EXIT_FAILURE); > } > > - if (strncmp(op_session_dir, "/var/lib/oprofile", strlen("/var/lib/oprofile"))) > + if (strncmp(op_session_dir, OP_SESSION_DIR_DEFAULT, strlen(OP_SESSION_DIR_DEFAULT))) > cerr << "NOTE: The sample data in this archive is located at " << op_session_dir << endl > - << "instead of the standard location of /var/lib/oprofile. Hence, when using opreport" << endl > + << "instead of the standard location of " << OP_SESSION_DIR_DEFAULT << ". Hence, when using opreport" << endl > << "and other post-processing tools on this archive, you must pass the following option:" << endl > << "\t--session-dir=" << op_session_dir << endl; > } > diff --git a/utils/Makefile.am b/utils/Makefile.am > index d34b060..408dc54 100644 > --- a/utils/Makefile.am > +++ b/utils/Makefile.am > @@ -8,7 +8,6 @@ AM_LDFLAGS = @OP_LDFLAGS@ > LIBS=@POPT_LIBS@ @LIBERTY_LIBS@ > > bin_PROGRAMS = ophelp op-check-perfevents > -dist_bin_SCRIPTS = opcontrol > > op_check_perfevents_SOURCES = op_perf_events_checker.c > op_check_perfevents_CPPFLAGS = ${AM_CFLAGS} @PERF_EVENT_FLAGS@ > diff --git a/utils/opcontrol b/utils/opcontrol > deleted file mode 100755 > index a5fa466..0000000 > --- a/utils/opcontrol > +++ /dev/null > @@ -1,2252 +0,0 @@ > -#!/bin/sh > -# > -# opcontrol is a script to control OProfile > -# opcontrol --help and opcontrol --list-events have info > -# > -# Copyright 2002 > -# Read the file COPYING > -# > -# Authors: John Levon, Philippe Elie, Will Cohen, Jens Wilke, Daniel Hansel > -# > -# Copyright IBM Corporation 2007 > -# > -# NOTE: This script should be as shell independent as possible > - > -SYSCTL=do_sysctl > - > -# A replacement function for the sysctl (procps package) utility which is > -# missing on some distribution (e.g. slack 7.0). > -# Handles only the -w option of sysctl. > -do_sysctl() > -{ > - if test "$1" != "-w"; then > - echo "$0 unknown sysctl option" >&2 > - exit 1 > - fi > - > - shift > - > - arg=`echo $1 | awk -F= '{print $1}'` > - val=`echo $1 | awk -F= '{print $2}'` > - > - dev_name=`echo $arg | tr . /` > - > - if test ! -f /proc/sys/$dev_name; then > - echo "/proc/sys/$dev_name does not exist or is not a regular file" >&2 > - exit 1 > - fi > - echo $val > /proc/sys/$dev_name > -} > - > -# Helper function to check if oprofile daemon is active. > -# Takes one argument: the "lock file" for the oprofile daemon. > -# The lock file may exist even if the daemon was killed or died in > -# some way. So we do a kill SIG_DFL to test whether the daemon is > -# truly alive. If the lock file is stale (daemon dead), the kill will > -# not return '0'. > -is_oprofiled_active() > -{ > - [ -f "$1" ] && kill -0 `cat "$1"` 2>/dev/null > -} > - > -# check value is set > -error_if_empty() > -{ > - if test -z "$2"; then > - echo "No value given for option $1" >&2 > - do_help > - exit 1 > - fi > -} > - > -# guess_number_base() checks if string is a valid octal(8), hexidecimal(16), > -# or decimal number(10). The value is returned in $?. Returns 0, if string > -# isn't a octal, hexidecimal, or decimal number. > -guess_number_base() > -{ > - case "$1" in > - 0[Xx]*[!0-9a-fA-F]*) return 0 ;; # Bad hex string > - 0[Xx][0-9a-fA-F]*) return 16 ;; # Hex > - *[!0-9]*) return 0 ;; # Some non-digit char > - [1-9]*) return 10 ;; # Base 10 > - 0*[89]*) return 0 ;; # Bad octal string > - 0*) return 8 ;; # Octal > - esac > - return 0 > -} > - > -# check value is a valid number > -error_if_not_number() > -{ > - error_if_empty "$1" "$2" > - guess_number_base "$2" > - if test "$?" -eq 0 ; then > - echo "Argument for $1, $2, is not a valid number." >&2 > - exit 1 > - fi > -} > - > -# check value is a base filename > -error_if_not_valid_savename() > -{ > - error_if_empty "$1" "$2" > - bname=`basename "$2"` > - if test "$2" != "$bname"; then > - echo "Argument for $1, $2, cannot change directory." >&2 > - exit 1 > - fi > - case "$2" in > - # The following catches anything that is not > - # 0-9, a-z, A-Z, an '-', ':', ',', '.', or '/' > - *[!-[:alnum:]_:,./]*) > - echo "Argument for $1, $2, not allow to have special characters" >&2 > - exit 1;; > - esac > -} > - > -error_if_invalid_arg() > -{ > - error_if_empty "$1" "$2" > - case "$2" in > - # The following catches anything that is not > - # 0-9, a-z, A-Z, an '-', ':', ',', '.', or '/' > - *[!-[:alnum:]_:,./]*) > - echo "Argument for $1, $2, is not valid argument." >&2 > - exit 1;; > - esac > -} > - > -# rm_device arguments $1=file_name > -rm_device() > -{ > - if test -c "$1"; then > - vecho "Removing $1" > - rm "$1" > - fi > -} > - > - > -# create_device arguments $1=file_name $2=MAJOR_NR $3=MINOR_NR > -create_device() > -{ > - vecho "Doing mknod $1" > - mknod "$1" c $2 $3 > - if test "$?" != "0"; then > - echo "Couldn't mknod $1" >&2 > - exit 1 > - fi > - chmod 700 "$1" > -} > - > - > -move_and_remove() > -{ > - if test -e $1; then > - mv $1 $SAMPLES_DIR/.tmp_reset.$$ > - rm -rf $SAMPLES_DIR/.tmp_reset.$$ > - fi > -} > - > - > -# verbose echo > -vecho() > -{ > - if test -n "$VERBOSE"; then > - echo $@ > - fi > -} > - > - > -is_tool_available() > -{ > - if which $1 > /dev/null 2>&1; then > - if test -x `which $1`; then > - return 1 > - fi > - fi > - > - return 0 > -} > - > - > -# print help message > -do_help() > -{ > - cat >&2 <<EOF > -opcontrol: usage: > - -l/--list-events list event types and unit masks > - -?/--help this message > - -v/--version show version > - --init loads the oprofile module and oprofilefs > - --setup give setup arguments (may be omitted) > - --status show configuration > - --start-daemon start daemon without starting profiling > - -s/--start start data collection > - -d/--dump flush the collected profiling data > - -t/--stop stop data collection > - -h/--shutdown stop data collection and kill daemon > - -V/--verbose[=all,sfile,arcs,samples,module,misc,ext] > - be verbose in the daemon log > - --reset clears out data from current session > - --save=name save data from current session to session_name > - --deinit unload the oprofile module and oprofilefs > - > - -e/--event=eventspec > - > - Choose an event. May be specified multiple times. Of the form > - "default" or "name:count:unitmask:kernel:user", where : > - > - name: event name, e.g. CPU_CLK_UNHALTED or RTC_INTERRUPTS > - count: reset counter value e.g. 100000 > - unitmask: hardware unit mask e.g. 0x0f > - kernel: whether to profile kernel: 0 or 1 > - user: whether to profile userspace: 0 or 1 > - > - -p/--separate=type,[types] > - > - Separate profiles as follows : > - > - none: no profile separation > - library: separate shared library profiles per-application > - kernel: same as library, plus kernel profiles > - thread: per-thread/process profiles > - cpu: per CPU profiles > - all: all of the above > - > - -c/--callgraph=#depth enable callgraph sample collection with a > - maximum depth. Use '0' to disable callgraph > - profiling. > - --session-dir=dir place sample database in dir instead of > - default location (/var/lib/oprofile) > - -i/--image=name[,names] list of binaries to profile (default is "all") > - --vmlinux=file vmlinux kernel image > - --no-vmlinux no kernel image (vmlinux) available > - --kernel-range=start,end kernel range vma address in hexadecimal > - --buffer-size=num kernel buffer size in sample units. > - Rules: A non-zero value goes into effect after > - a '--shutdown/start' sequence. A value of > - zero sets this parameter back to default value > - but does not go into effect until after a > - '--deinit/init' sequence. > - --buffer-watershed kernel buffer watershed in sample units (2.6 > - kernel). Same rules as defined for > - buffer-size. > - --cpu-buffer-size=num per-cpu buffer size in units (2.6 kernel) > - Same rules as defined for buffer-size. > - --xen Xen image (for Xen only) > - --active-domains=<list> List of domains in profiling session (for Xen) > - (list contains domain ids separated by commas) > - > - System z specific options > - > - --s390hwsampbufsize=num Number of 2MB areas used per CPU for storing sample data. > -EOF > -} > - > - > -# load the module and mount oprofilefs > -load_module_26() > -{ > - grep oprofilefs /proc/filesystems >/dev/null > - if test "$?" -ne 0; then > - modprobe oprofile > - if test "$?" != "0"; then > - # couldn't load the module > - return > - fi > - grep oprofile /proc/modules >/dev/null > - if test "$?" != "0"; then > - # didn't find module > - return > - fi > - grep oprofilefs /proc/filesystems >/dev/null > - if test "$?" -ne 0; then > - # filesystem still not around > - return > - fi > - fi > - mkdir /dev/oprofile >/dev/null 2>&1 > - grep oprofilefs /proc/mounts >/dev/null > - if test "$?" -ne 0; then > - mount -t oprofilefs nodev /dev/oprofile >/dev/null > - fi > - KERNEL_SUPPORT=yes > - OPROFILE_AVAILABLE=yes > -} > - > - > - > -load_module() > -{ > - OPROFILE_AVAILABLE=no > - load_module_26 > - if test "$OPROFILE_AVAILABLE" != "yes"; then > - echo "Kernel doesn't support oprofile" >&2 > - exit 1 > - fi > -} > - > -# setup variables related to path or daemon. Set vars according to following > -# relationship: command-line-option > config-file-settings > defaults. > -# Note that upon entry SESSION_DIR may be set by command-line option. > -do_init_daemon_vars() > -{ > - # load settings from config file, keeping command-line value > - # of SESSION_DIR if necessary. > - if test -n "$SESSION_DIR"; then > - SAVED=$SESSION_DIR > - fi > - do_load_setup > - if test -n "$SAVED"; then > - SESSION_DIR=$SAVED > - fi > - > - # daemon parameters (as in op_config.h). Note that we preserve > - # any previous value of SESSION_DIR > - if test -z "$SESSION_DIR"; then > - SESSION_DIR="/var/lib/oprofile" > - fi > - LOCK_FILE="$SESSION_DIR/lock" > - SAMPLES_DIR="$SESSION_DIR/samples" > - LOG_FILE="$SAMPLES_DIR/oprofiled.log" > - CURRENT_SAMPLES_DIR="$SAMPLES_DIR/current" > -} > - > - > -# pick the appropriate device mount based on kernel > -decide_oprofile_device_mount() > -{ > - if test "$KERNEL_SUPPORT" = "yes"; then > - MOUNT="/dev/oprofile" > - else > - MOUNT="/proc/sys/dev/oprofile" > - fi > -} > - > - > -# pick the appropriate locations device for oprofile based on kernel > -decide_oprofile_device() > -{ > - if test "$KERNEL_SUPPORT" = "yes"; then > - DEVICE_FILE="$MOUNT/buffer" > - else > - DEVICE_FILE="$SESSION_DIR/opdev" > - NOTE_DEVICE_FILE="$SESSION_DIR/opnotedev" > - HASH_MAP_DEVICE_FILE="$SESSION_DIR/ophashmapdev" > - fi > -} > - > -# initialise parameters > -do_init() > -{ > - # for these three buffer size == 0 means use the default value > - # hard-coded in op_user.h > - BUF_SIZE=0 > - BUF_WATERSHED=0 > - CPU_BUF_SIZE=0 > - NOTE_SIZE=0 > - VMLINUX= > - XENIMAGE="none" > - VERBOSE="" > - SEPARATE_LIB=0 > - SEPARATE_KERNEL=0 > - SEPARATE_THREAD=0 > - SEPARATE_CPU=0 > - CALLGRAPH=0 > - IBS_FETCH_EVENTS="" > - IBS_FETCH_COUNT=0 > - IBS_FETCH_UNITMASK=0 > - IBS_OP_EVENTS="" > - IBS_OP_COUNT=0 > - IBS_OP_UNITMASK=0 > - > - # System z specific values > - S390_HW_SAMPLER=0 > - S390_HW_SAMPLER_BUFSIZE=0 > - > - OPROFILED="$OPDIR/oprofiled" > - > - # location for daemon setup information > - SETUP_DIR="/root/.oprofile" > - SETUP_FILE="$SETUP_DIR/daemonrc" > - SEC_SETUP_FILE="$SETUP_DIR/daemonrc_new" > - > - # initialize daemon vars > - decide_oprofile_device_mount > - CPUTYPE=`cat $MOUNT/cpu_type` > - OP_COUNTERS=`ls $MOUNT/ | grep "^[0-9]\+\$" | tr "\n" " "` > - OP_COUNTERS="$OP_COUNTERS `ls $MOUNT/ | grep "^timer\+\$"`" > - NR_CHOSEN=0 > - > - do_init_daemon_vars > - decide_oprofile_device > - > - DEFAULT_EVENT=`$OPHELP --get-default-event` > - > - IS_TIMER=0 > - IS_PERFMON=0 > - if test "$CPUTYPE" = "timer"; then > - IS_TIMER=1 > - else > - case "$CPUTYPE" in > - s390/*) > - S390_HW_SAMPLER=1 > - ;; > - ia64/*) > - IS_PERFMON=$KERNEL_SUPPORT > - ;; > - ppc64/power8) > - echo "*** IBM POWER 8 processor is not supported with opcontrol. Please use operf instead. ***" > - do_deinit > - exit 1 > - ;; > - aarch64/*) > - echo "*** ARM AArch64 processors are not supported with opcontrol. Please use operf instead. ***" > - do_deinit > - exit 1 > - ;; > - esac > - fi > - > - # Ignore configured events when running in timer mode. > - if test "$IS_TIMER" = 1; then > - NR_CHOSEN=0 > - fi > -} > - > - > -create_dir() > -{ > - if test ! -d "$1"; then > - mkdir -p "$1" > - if test "$?" != "0"; then > - echo "Couldn't mkdir -p $1" >&2 > - exit 1 > - fi > - chmod 755 "$1" > - fi > -} > - > -get_event() > -{ > - GOTEVENT=`eval "echo \\$CHOSEN_EVENTS_$1"` > -} > - > -set_event() > -{ > - eval "CHOSEN_EVENTS_$1=$2" > -} > - > - > -# save all the setup related information > -do_save_setup() > -{ > - create_dir "$SETUP_DIR" > - SAVE_SETUP_FILE="$SETUP_FILE" > - > -# If the daemon is currently running, we want changes to the daemon config > -# stored in the secondary cache file so that 'opcontrol --status' will > -# show actual config data for the running daemon. The next time the > -# daemon is restarted, we'll reload the config data from this secondary > -# cache file. > - > - if is_oprofiled_active "$LOCK_FILE"; then > - SETUP_FILE="$SEC_SETUP_FILE" > - echo "The profiling daemon is currently active, so changes to the configuration" > - echo "will be used the next time you restart oprofile after a --shutdown or --deinit." > - fi > - > - touch $SETUP_FILE > - chmod 644 $SETUP_FILE > - >$SETUP_FILE > - > - echo "SESSION_DIR=$SESSION_DIR" >>$SETUP_FILE > - > - if test "$NR_CHOSEN" != "0"; then > - for f in `seq 0 $((NR_CHOSEN - 1))`; do > - get_event $f > - echo "CHOSEN_EVENTS_${f}=$GOTEVENT" >>$SETUP_FILE > - done > - fi > - > - echo "NR_CHOSEN=$NR_CHOSEN" >>$SETUP_FILE > - > - echo "SEPARATE_LIB=$SEPARATE_LIB" >> $SETUP_FILE > - echo "SEPARATE_KERNEL=$SEPARATE_KERNEL" >> $SETUP_FILE > - echo "SEPARATE_THREAD=$SEPARATE_THREAD" >> $SETUP_FILE > - echo "SEPARATE_CPU=$SEPARATE_CPU" >> $SETUP_FILE > - echo "VMLINUX=$VMLINUX" >> $SETUP_FILE > - echo "IMAGE_FILTER=$IMAGE_FILTER" >> $SETUP_FILE > - # write the actual information to file > - if test "$BUF_SIZE" != "0"; then > - echo "BUF_SIZE=$BUF_SIZE" >> $SETUP_FILE > - fi > - if test "$BUF_WATERSHED" != "0"; then > - echo "BUF_WATERSHED=$BUF_WATERSHED" >> $SETUP_FILE > - fi > - if test "$KERNEL_SUPPORT" = "yes"; then > - echo "CPU_BUF_SIZE=$CPU_BUF_SIZE" >> $SETUP_FILE > - fi > - if test "$KERNEL_SUPPORT" != "yes"; then > - echo "NOTE_SIZE=$NOTE_SIZE" >> $SETUP_FILE > - fi > - echo "CALLGRAPH=$CALLGRAPH" >> $SETUP_FILE > - if test "$KERNEL_RANGE"; then > - echo "KERNEL_RANGE=$KERNEL_RANGE" >> $SETUP_FILE > - fi > - echo "XENIMAGE=$XENIMAGE" >> $SETUP_FILE > - if test "$XEN_RANGE"; then > - echo "XEN_RANGE=$XEN_RANGE" >> $SETUP_FILE > - fi > - if test "$S390_HW_SAMPLER" = "1" -a "$S390_HW_SAMPLER_BUFSIZE" != "0"; then > - echo "S390_HW_SAMPLER_BUFSIZE=$S390_HW_SAMPLER_BUFSIZE" >> $SETUP_FILE > - fi > - SETUP_FILE="$SAVE_SETUP_FILE" > -} > - > - > -# reload all the setup-related information > -do_load_setup() > -{ > -# If a secondary setup file exists and the daemon is not running, > -# then we'll move the data from the secondary file to the actual > -# setup file to prepare for daemon startup. > - if test -z "$SESSION_DIR"; then > - __TMP_SESSION_DIR="/var/lib/oprofile" > - else > - __TMP_SESSION_DIR="$SESSION_DIR" > - fi > - > - if test -f "$SEC_SETUP_FILE"; then > - is_oprofiled_active "$__TMP_SESSION_DIR/lock" \ > - || mv "$SEC_SETUP_FILE" "$SETUP_FILE" > - fi > - > - if test ! -f "$SETUP_FILE"; then return; fi > - > - while IFS== read -r arg val; do > - case "$arg" in > - # The following catches anything that is not > - # 0-9, a-z, A-Z, or an '_' > - *[![:alnum:]_]*) > - echo "Invalid variable \"$arg\" in $SETUP_FILE." > - exit 1;; > - esac > - case "$val" in > - # The following catches anything that is not > - # 0-9, a-z, A-Z, an '-', ':', ',', '.', or '/' > - *[!-[:alnum:]_:,./]*) > - echo "Invalid value \"$val\" for $arg in $SETUP_FILE." > - exit 1;; > - esac > - eval "${arg}=${val}" > - done < $SETUP_FILE > -} > - > - > -check_valid_args() > -{ > - if test -z "$VMLINUX"; then > - echo "No vmlinux file specified. You must specify the correct vmlinux file, e.g." >&2 > - echo "opcontrol --vmlinux=/path/to/vmlinux" >&2 > - echo "If you do not have a vmlinux file, use " >&2 > - echo "opcontrol --no-vmlinux" >&2 > - echo "Enter opcontrol --help for full options" >&2 > - exit 1 > - fi > - > - if test -f "$VMLINUX"; then > - return > - fi > - > - if test "$VMLINUX" = "none"; then > - return > - fi > - > - echo "The specified vmlinux file \"$VMLINUX\" doesn't exist." >&2 > - exit 1 > - > -# similar check for Xen image > - if test -f "$XENIMAGE"; then > - return > - fi > - > - if test "$XENIMAGE" = "none"; then > - return > - fi > - > - echo "The specified XenImage file \"$XENIMAGE\" does not exist." >&2 > - exit 1 > -} > - > - > -# get start and end points of a file image (linux kernel or xen) > -# get_image_range parameter: $1=type_of_image (linux or xen) > -get_image_range() > -{ > - if test "$1" = "xen"; then > - if test ! -z "$XEN_RANGE"; then > - return; > - fi > - FILE_IMAGE="$XENIMAGE" > - else > - if test ! -z "$KERNEL_RANGE"; then > - return; > - fi > - FILE_IMAGE="$VMLINUX" > - fi > - > - if test "$FILE_IMAGE" = "none"; then > - return; > - fi > - > - if is_tool_available objdump; then > - echo "objdump is not installed on this system, use opcontrol --kernel-range=start,end or opcontrol --xen-range= or install objdump" > - exit 1 > - fi > - > - # start at the start of .text, and end at _etext > - range_info=`objdump -h $FILE_IMAGE 2>/dev/null | grep " .text "` > - tmp1=`echo $range_info | awk '{print $4}'` > - tmp2=`objdump -t $FILE_IMAGE 2>/dev/null | grep "_etext$" | awk '{ print $1 }'` > - > - if test -z "$tmp1" -o -z "$tmp2"; then > - echo "The specified file $FILE_IMAGE does not seem to be valid" >&2 > - echo "Make sure you are using the non-compressed image file (e.g. vmlinux not vmlinuz)" >&2 > - vecho "found start as \"$tmp1\", end as \"$tmp2\"" >&2 > - exit 1 > - fi > - > - if test "$1" = "xen"; then > - XEN_RANGE="`echo $tmp1`,`echo $tmp2`" > - vecho "XEN_RANGE $XEN_RANGE" > - else > - KERNEL_RANGE="`echo $tmp1`,`echo $tmp2`" > - vecho "KERNEL_RANGE $KERNEL_RANGE" > - fi > -} > - > - > -# validate --separate= parameters. This function is called with IFS=, > -# so on each argument is splitted > -validate_separate_args() > -{ > - error_if_empty $1 $2 # we need at least one argument > - local i=1 > - SEPARATE_LIB=0 > - SEPARATE_KERNEL=0 > - SEPARATE_THREAD=0 > - SEPARATE_CPU=0 > - while [ "$i" -lt "$#" ]; do > - shift > - case "$1" in > - lib|library) > - SEPARATE_LIB=1 > - ;; > - kernel) > - # first implied by second > - SEPARATE_LIB=1 > - SEPARATE_KERNEL=1 > - ;; > - thread) > - SEPARATE_THREAD=1 > - ;; > - cpu) > - SEPARATE_CPU=1 > - ;; > - all) > - SEPARATE_LIB=1 > - SEPARATE_KERNEL=1 > - SEPARATE_THREAD=1 > - SEPARATE_CPU=1 > - ;; > - none) > - SEPARATE_LIB=0 > - SEPARATE_KERNEL=0 > - SEPARATE_THREAD=0 > - SEPARATE_CPU=0 > - ;; > - *) > - echo "invalid --separate= argument: $1" > - exit 1 > - esac > - done > -} > - > - > -# check the counters make sense, and resolve the hardware allocation > -verify_counters() > -{ > - if test "$IS_TIMER" = 1; then > - if test "$NR_CHOSEN" != 0; then > - echo "You cannot specify any performance counter events" >&2 > - echo "because OProfile is in timer mode." >&2 > - exit 1 > - fi > - return > - fi > - > - OPHELP_ARGS= > - > - if test "$NR_CHOSEN" != 0; then > - for f in `seq 0 $((NR_CHOSEN - 1))`; do > - get_event $f > - if test "$GOTEVENT" != ""; then > - verify_ibs $GOTEVENT > - OPHELP_ARGS="$OPHELP_ARGS $GOTEVENT" > - fi > - done > - > - if test ! -z "$OPHELP_ARGS" ; then > - HW_CTRS=`$OPHELP --check-events $OPHELP_ARGS --callgraph=$CALLGRAPH` > - if test "$?" != 0; then > - exit 1 > - fi > - fi > - fi > -} > - > - > -# setup any needed default value in chosen events > -normalise_events() > -{ > - if test "$NR_CHOSEN" -le 0 || test "$IS_TIMER" = 1; then > - return > - fi > - > - for f in `seq 0 $((NR_CHOSEN - 1))`; do > - get_event $f > - if test "$GOTEVENT" != ""; then > - EVENT=`echo $GOTEVENT | awk -F: '{print $1}'` > - EVENT_VAL=`$OPHELP $EVENT` > - if test "$?" != 0; then > - exit 1 > - fi > - COUNT=`echo $GOTEVENT | awk -F: '{print $2}'` > - UNIT_MASK=`echo $GOTEVENT | awk -F: '{print $3}'` > - KERNEL=`echo $GOTEVENT | awk -F: '{print $4}'` > - USER=`echo $GOTEVENT | awk -F: '{print $5}'` > - TMPEVENT="$EVENT:$COUNT:$UNIT_MASK" > - UNIT_MASK=`$OPHELP --unit-mask $TMPEVENT` > - UNIT_MASK_NAMED="$UNIT_MASK" > - if test "$?" != 0; then > - exit 1 > - fi > - if test -z "$KERNEL"; then > - KERNEL=1 > - fi > - if test -z "$USER"; then > - USER=1 > - fi > - > - set_event $f "$EVENT:$COUNT:$UNIT_MASK:$KERNEL:$USER" > - fi > - done > -} > - > - > -# get and check specified options > -do_options() > -{ > - EXCLUSIVE_ARGC=0 > - SETUP=no > - NEED_SETUP=no > - SEEN_EVENT=0 > - > - # note: default settings have already been loaded > - > - while [ "$#" -ne 0 ] > - do > - arg=`printf %s $1 | awk -F= '{print $1}'` > - val=`printf %s $1 | awk -F= '{print $2}'` > - shift > - if test -z "$val"; then > - local possibleval=$1 > - printf %s $1 "$possibleval" | grep ^- >/dev/null 2>&1 > - if test "$?" != "0"; then > - val=$possibleval > - if [ "$#" -ge 1 ]; then > - shift > - fi > - fi > - fi > - > - case "$arg" in > - > - --init) > - # this is already done in load_module > - # because need to know the processor type > - # and number of registers > - INIT=yes; > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - ;; > - > - --setup) > - SETUP=yes > - ;; > - > - --start-daemon) > - if test "$KERNEL_SUPPORT" != "yes"; then > - echo "$arg unsupported. use \"--start\"" >&2 > - exit 1 > - fi > - START_DAEMON=yes > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - ;; > - > - -s|--start) > - START=yes > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - ;; > - > - -d|--dump) > - DUMP=yes > - ONLY_DUMP=yes > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - ;; > - > - -t|--stop) > - if test "$KERNEL_SUPPORT" != "yes"; then > - echo "$arg unsupported. use \"--shutdown\"" >&2 > - exit 1 > - fi > - DUMP=yes > - STOP=yes > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - ;; > - > - -h|--shutdown) > - DUMP=yes > - STOP=yes > - KILL_DAEMON=yes > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - ;; > - > - --status) > - STATUS=yes > - ;; > - > - --reset) > - DUMP=yes > - RESET=yes > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - ;; > - > - --save) > - error_if_not_valid_savename "$arg" "$val" > - DUMP=yes > - SAVE_SESSION=yes > - SAVE_NAME=$val > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - ;; > - > - --deinit) > - DUMP=yes > - test ! -f "$LOCK_FILE" || { > - STOP=yes > - KILL_DAEMON=yes > - } > - DEINIT=yes > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - ;; > - > - # --setup options > - > - --session-dir) > - # already processed > - ;; > - --buffer-size) > - error_if_not_number "$arg" "$val" > - BUF_SIZE=$val > - DO_SETUP=yes > - ;; > - --buffer-watershed) > - if test "$KERNEL_SUPPORT" != "yes"; then > - echo "$arg unsupported for this kernel version" > - exit 1 > - fi > - error_if_not_number "$arg" "$val" > - BUF_WATERSHED=$val > - DO_SETUP=yes > - ;; > - --cpu-buffer-size) > - if test "$KERNEL_SUPPORT" != "yes"; then > - echo "$arg unsupported for this kernel version" > - exit 1 > - fi > - error_if_not_number "$arg" "$val" > - CPU_BUF_SIZE=$val > - DO_SETUP=yes > - ;; > - -e|--event) > - error_if_invalid_arg "$arg" "$val" > - # reset any read-in defaults from daemonrc > - if test "$SEEN_EVENT" = "0"; then > - NR_CHOSEN=0 > - SEEN_EVENT=1 > - fi > - if test "$val" = "default"; then > - val=$DEFAULT_EVENT > - fi > - set_event $NR_CHOSEN "$val" > - NR_CHOSEN=`expr $NR_CHOSEN + 1` > - DO_SETUP=yes > - ;; > - -p|--separate) > - OLD_IFS=$IFS > - IFS=, > - validate_separate_args $arg $val > - IFS=$OLD_IFS > - DO_SETUP=yes > - ;; > - -c|--callgraph) > - if test ! -f $MOUNT/backtrace_depth; then > - echo "Call-graph profiling unsupported on this kernel/hardware" >&2 > - exit 1 > - fi > - error_if_not_number "$arg" "$val" > - CALLGRAPH=$val > - DO_SETUP=yes > - ;; > - --vmlinux) > - error_if_invalid_arg "$arg" "$val" > - VMLINUX=$val > - DO_SETUP=yes > - ;; > - --no-vmlinux) > - VMLINUX=none > - DO_SETUP=yes > - ;; > - --kernel-range) > - error_if_invalid_arg "$arg" "$val" > - KERNEL_RANGE=$val > - DO_SETUP=yes > - ;; > - --xen) > - error_if_invalid_arg "$arg" "$val" > - XENIMAGE=$val > - DO_SETUP=yes > - ;; > - --active-domains) > - error_if_invalid_arg $arg $val > - ACTIVE_DOMAINS=$val > - DO_SETUP=yes > - ;; > - -i|--image) > - error_if_invalid_arg "$arg" "$val" > - if test "$val" = "all"; then > - IMAGE_FILTER= > - else > - IMAGE_FILTER=$val > - fi > - DO_SETUP=yes > - ;; > - > - -V|--verbose) > - if test -z "$val"; then > - VERBOSE="all" > - else > - error_if_invalid_arg "$arg" "$val" > - VERBOSE=$val > - fi > - ;; > - > - -l|--list-events) > - EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1` > - EXCLUSIVE_ARGV="$arg" > - exec $OPHELP > - ;; > - > - --s390hwsampbufsize) > - error_if_not_number "$arg" "$val" > - S390_HW_SAMPLER_BUFSIZE=$val > - DO_SETUP=yes > - ;; > - > - > - *) > - echo "Unknown option \"$arg\". See opcontrol --help" >&2 > - exit 1 > - ;; > - esac > - done > - > - normalise_events > - verify_counters > - > - # error checking to make sure options make sense > - if test "$EXCLUSIVE_ARGC" -gt 1; then > - echo "Option \"$EXCLUSIVE_ARGV\" not valid with other options." >&2 > - exit 1 > - fi > - > - if test "$SETUP" = "yes" -a "$DO_SETUP" != "yes"; then > - echo "No options specified for --setup." >&2 > - exit 1 > - fi > - > - if test -n "$VERBOSE"; then > - if test "$START" != "yes" -a "$START_DAEMON" != "yes"; then > - echo "Option --verbose may only be used with --start or --start-daemon" >&2 > - exit 1 > - fi > - fi > - > - if test "$DO_SETUP" = "yes"; then > - SETUP="$DO_SETUP" > - fi > - > - if test "$EXCLUSIVE_ARGC" -eq 1 -a "$SETUP" = "yes"; then > - if test "$EXCLUSIVE_ARGV" != "--start-daemon" -a "$EXCLUSIVE_ARGV" != "--start"; then > - echo "Option \"--setup\" not valid with \"$EXCLUSIVE_ARGV\"." >&2 > - exit 1 > - fi > - fi > - > - vecho "Parameters used:" > - vecho "SESSION_DIR $SESSION_DIR" > - vecho "LOCK_FILE $LOCK_FILE" > - vecho "SAMPLES_DIR $SAMPLES_DIR" > - vecho "CURRENT_SAMPLES_DIR $CURRENT_SAMPLES_DIR" > - vecho "CPUTYPE $CPUTYPE" > - if test "$BUF_SIZE" != "0"; then > - vecho "BUF_SIZE $BUF_SIZE" > - else > - vecho "BUF_SIZE default value" > - fi > - if test "$BUF_WATERSHED" != "0"; then > - vecho "BUF_WATERSHED $BUF_WATERSHED" > - else > - vecho "BUF_WATERSHED default value" > - fi > - if test "$KERNEL_SUPPORT" = "yes"; then > - if test "$CPU_BUF_SIZE" != "0"; then > - vecho "CPU_BUF_SIZE $CPU_BUF_SIZE" > - else > - vecho "CPU_BUF_SIZE default value" > - fi > - fi > - > - vecho "SEPARATE_LIB $SEPARATE_LIB" > - vecho "SEPARATE_KERNEL $SEPARATE_KERNEL" > - vecho "SEPARATE_THREAD $SEPARATE_THREAD" > - vecho "SEPARATE_CPU $SEPARATE_CPU" > - vecho "CALLGRAPH $CALLGRAPH" > - vecho "VMLINUX $VMLINUX" > - vecho "KERNEL_RANGE $KERNEL_RANGE" > - vecho "XENIMAGE $XENIMAGE" > - vecho "XEN_RANGE $XEN_RANGE" > -} > - > - > -# stop any existing daemon > -do_stop() > -{ > - if test ! -f "$LOCK_FILE"; then > - echo "Daemon not running" >&2 > - return > - fi > - > - kill -0 `cat $LOCK_FILE` 2>/dev/null > - if test "$?" -ne 0; then > - echo "Detected stale lock file. Removing." >&2 > - rm -f "$LOCK_FILE" > - return > - fi > - > - if test $KERNEL_SUPPORT = "yes" \ > - && test 0 != $(cat /dev/oprofile/enable); then > - echo "Stopping profiling." > - echo 0 >/dev/oprofile/enable > - fi > - kill -USR2 `cat $LOCK_FILE` 2>/dev/null > -} > - > - > -# kill the daemon process(es) > -do_kill_daemon() > -{ > - if test ! -f "$LOCK_FILE"; then > - # no error message, do_kill_daemon imply stop and stop already > - # output "Daemon not running" > - return > - fi > - > - kill -0 `cat $LOCK_FILE` 2>/dev/null > - if test "$?" -ne 0; then > - echo "Detected stale lock file. Removing." >&2 > - rm -f "$LOCK_FILE" > - return > - fi > - > - echo "Killing daemon." > - > - if test $KERNEL_SUPPORT = "yes"; then > - kill -TERM `cat $LOCK_FILE` > - else > - echo 1 >/proc/sys/dev/oprofile/dump_stop > - fi > - > - COUNT=0 > - while test -n "`pidof oprofiled`" > - do > - sleep 1 > - > - # because oprofiled only sets a variable inside the > - # signal handler itself, it's possible to miss a > - # signal just before it goes to sleep waiting for > - # data from the kernel that never arrives. So we > - # remind it it needs to die - this works because > - # the signal will bring oprofiled out of the kernel > - # back into userspace > - if test $KERNEL_SUPPORT = "yes"; then > - pid=`cat $LOCK_FILE 2>/dev/null` > - kill -TERM "$pid" 2>/dev/null > - fi > - > - COUNT=`expr $COUNT + 1` > - > - # IBS can generate a large number of samples/events. > - # Therefore, extend the delay before killing > - if test "$IBS_FETCH_COUNT" != "0" \ > - -o "$IBS_OP_COUNT" != "0" ; then > - DELAY_KILL=60 > - else > - DELAY_KILL=15 > - fi > - if test "$COUNT" -eq "$DELAY_KILL"; then > - echo "Daemon stuck shutting down; killing !" > - kill -9 `cat $LOCK_FILE` > - fi > - done > - sleep 1 > - # already removed unless we forced the kill > - rm -f "$SESSION_DIR/lock" > -} > - > - > -# remove any old files from a previous run > -prep_jitdump() { > - local dumpdir=/tmp/.oprofile/jitdump > - # VMs may already be running when profiling is started, so > - # remove only dump files that are not in use > - for I in $dumpdir/*; do > - test -f $I || continue; > - local pid=`basename $I .dump`; > - if test -d /proc/$pid; then > - local files=`find /proc/$pid/fd -lname $I`; > - test -n "$files" && continue; > - fi > - rm -f $I; > - done > -} > - > -# setup and start module > -do_setup() > -{ > - create_dir "$SESSION_DIR" > - > - create_dir "$CURRENT_SAMPLES_DIR" > - > - prep_jitdump; > -} > - > - > -# set a sysctl/oprofilefs parameter > -set_param() > -{ > - if test "$KERNEL_SUPPORT" = "yes"; then > - if test "$IS_TIMER" = 1 -a "$1" = "backtrace_depth"; then > - echo $2 >$MOUNT/$1 2> /dev/null > - if test "$2" -ne 0; then > - result=`cat $MOUNT/$1` > - if test "$result" -ne "$2"; then > - echo "Callgraph profiling not supported on this system in Timer mode" > - echo "Continuing with flat profile run" > - CALLGRAPH=0 > - echo "CALLGRAPH=$CALLGRAPH" >> $SETUP_FILE > - fi > - fi > - else > - echo $2 >$MOUNT/$1 > - fi > - else > - $SYSCTL -w dev.oprofile.$1=$2 > - fi > -} > - > - > -# set a sysctl/oprofilefs counter parameter > -set_ctr_param() > -{ > - # no such thing for perfmon > - if test "$IS_PERFMON" = "yes"; then > - return > - fi > - > - if test "$KERNEL_SUPPORT" = "yes"; then > - if test "$1" = "timer" -a "$2" != "enabled"; then > - # For now everything other than 'enabled' is > - # unsupported for the `timer' counter. > - return > - fi > - if test -e $MOUNT/$1; then > - echo $3 >$MOUNT/$1/$2 2>/dev/null > - if test $? -ne 0; then > - echo "Value $3 is not accepted by $MOUNT/$1/$2" > - exit 1 > - fi > - else > - echo -n "Error: counter $1 not available" > - if test -e /proc/sys/kernel/nmi_watchdog; then > - echo " nmi_watchdog using this resource ? Try:" > - echo "opcontrol --deinit" > - echo "echo 0 > /proc/sys/kernel/nmi_watchdog" > - fi > - exit 1 > - fi > - else > - $SYSCTL -w dev.oprofile.$1.$2=$3 > - fi > -} > - > - > -# returns 1 if $CPUTYPE is a PPC64 variant > -is_non_cell_ppc64_variant() > -{ > - case "$1" in > - ppc64/*cell*) > - return 0 > - ;; > - ppc64/*) > - return 1 > - ;; > - *) > - return 0 > - ;; > - esac > -} > - > - > -# The arch_event_validate procedure gives the > -# opportunity to validate events and enforce any > -# arch-specific restritions, etc. > -arch_event_validate() > -{ > - > - is_non_cell_ppc64_variant $CPUTYPE > - if test $? -ne 0 ; then > - # For PPC64 architectures, the values required to program > - # MMCRs for the given event are returned along with the event. > - # Here we use those values to ensure that all chosen events > - # are from the same group. > - MMCR0=`echo $EVENT_STR | awk '{print $2}'` > - MMCR1=`echo $EVENT_STR | awk '{print $3}'` > - MMCRA=`echo $EVENT_STR | awk '{print $4}'` > - MMCR0_VAL=`echo $MMCR0 | awk -F: '{print $2}'` > - MMCR1_VAL=`echo $MMCR1 | awk -F: '{print $2}'` > - MMCRA_VAL=`echo $MMCRA | awk -F: '{print $2}'` > - > - ## mmcr0, mmcr1, mmcra are for all ppc64 counters > - # Save first event mmcr settings to compare with additional > - # events. All events must have the same mmcrx values i.e. be in > - # the same group. Only one event is assigned per counter, > - # hence there will not be a conflict on the counters > - if [ "$MMCR0_CK_VAL" = "" ] ; then > - MMCR0_CK_VAL=$MMCR0_VAL > - MMCR1_CK_VAL=$MMCR1_VAL > - MMCRA_CK_VAL=$MMCRA_VAL > - else > - # make sure all events are from the same group > - if test $MMCR0_CK_VAL != $MMCR0_VAL \ > - -o $MMCR1_CK_VAL != $MMCR1_VAL \ > - -o $MMCRA_CK_VAL != $MMCRA_VAL ; then > - echo "ERROR: The specified events are not from the same group." > - echo " Use 'opcontrol --list-events' to see event groupings." > - exit 1 > - fi > - fi > - > - # Check if all user/kernel flags per-counter are matching. > - if [ "$USER_CK" = "" ] ; then > - USER_CK=$USER > - KERNEL_CK=$KERNEL > - else > - if test $USER_CK != $USER \ > - -o $KERNEL_CK != $KERNEL ; then > - echo "ERROR: All kernel/user event flags must match." > - exit 1 > - fi > - fi > - fi > - if [ "$CPUTYPE" = "ppc64/cell-be" ]; then > - event_num=`echo $EVENT_STR | awk '{print $1}'` > - # PPU event and cycle events can be measured at > - # the same time. SPU event can not be measured > - # at the same time as any other event. Similarly for > - # SPU Cycles > - > - # We use EVNT_MSK to track what events have already > - # been seen. Valid values are: > - # NULL string - no events seen yet > - # 1 - PPU CYCLES or PPU Event seen > - # 2 - SPU CYCLES seen > - # 3 - SPU EVENT seen > - > - # check if event is PPU_CYCLES > - if [ "$event_num" = "1" ]; then > - if [ "$EVNT_MSK" = "1" ] || [ "$EVNT_MSK" = "" ]; then > - EVNT_MSK=1 > - else > - echo "PPU CYCLES not compatible with previously specified event" > - exit 1 > - fi > - > - # check if event is SPU_CYCLES > - elif [ "$event_num" = "2" ]; then > - if [ "$EVNT_MSK" = "" ]; then > - EVNT_MSK=2 > - else > - echo "SPU CYCLES not compatible with any other event" > - exit 1 > - fi > - > - # check if event is SPU Event profiling > - elif [ "$event_num" -ge "4100" ] && [ "$event_num" -le "4163" ] ; then > - if [ "$EVNT_MSK" = "" ]; then > - EVNT_MSK=3 > - else > - echo "SPU event profiling not compatible with any other event" > - exit 1 > - fi > - > - # Check to see that the kernel supports SPU event > - # profiling. Note, if the file exits it should have > - # the LSB bit set to 1 indicating SPU event profiling > - # support. For now, it is sufficient to test that the > - # file exists. > - if test ! -f /dev/oprofile/cell_support; then > - echo "Kernel does not support SPU event profiling" > - exit 1 > - fi > - > - # check if event is PPU Event profiling (all other > - # events are PPU events) > - else > - if [ "$EVNT_MSK" = "1" ] || [ "$EVNT_MSK" = "" ]; then > - EVNT_MSK=1 > - else > - echo "PPU profiling not compatible with previously specified event" > - exit 1 > - fi > - fi > - fi > - if test "$S390_HW_SAMPLER" = "1" -a "$EVENT" = "HWSAMPLING"; then > - if test "$CALLGRAPH" != "0"; then > - echo "Callgraph sample collection is not supported with " >&2 > - echo "System z hardware sampling. Please use --callgraph=0 " >&2 > - echo "or enable timer based sampling." >&2 > - exit 1 > - fi > - echo "$COUNT" > $MOUNT/0/count > - NEW_COUNT=`cat $MOUNT/0/count` > - if test "$NEW_COUNT" -lt "$COUNT"; then > - echo "Warning: Hardware sampling intervals higher than $NEW_COUNT are not supported." >&2 > - echo "Value is set to $NEW_COUNT." >&2 > - COUNT=$NEW_COUNT > - fi > - if test "$NEW_COUNT" -gt "$COUNT"; then > - echo "Warning: Hardware sampling intervals lower than $NEW_COUNT are not supported." >&2 > - echo "Value is set to $NEW_COUNT." >&2 > - COUNT=$NEW_COUNT > - fi > - fi > - > - len=`echo -n $event_num | wc -c` > - num_chars_in_grpid=`expr $len - 2` > - GRP_NUM_VAL=`echo | awk '{print substr("'"${event_num}"'",1,"'"${num_chars_in_grpid}"'")}'` > - if [ "$GRP_NUM_CK_VAL" = "" ] ; then > - GRP_NUM_CK_VAL=$GRP_NUM_VAL > - else > - if test $GRP_NUM_CK_VAL != $GRP_NUM_VAL ; then > - echo "ERROR: The specified events are not from the same group." >&2 > - echo " Use 'opcontrol --list-events' to see event groupings." >&2 > - exit 1 > - fi > - fi > -} > - > - > -do_param_setup() > -{ > - # different names > - if test $BUF_SIZE != 0; then > - if test "$KERNEL_SUPPORT" = "yes"; then > - echo $BUF_SIZE >$MOUNT/buffer_size > - else > - $SYSCTL -w dev.oprofile.bufsize=$BUF_SIZE > - fi > - fi > - > - if test $BUF_WATERSHED != 0; then > - if test "$KERNEL_SUPPORT" = "yes"; then > - echo $BUF_WATERSHED >$MOUNT/buffer_watershed > - else > - echo "buffer-watershed not supported - ignored" >&2 > - fi > - fi > - > - if test $CPU_BUF_SIZE != 0; then > - if test "$KERNEL_SUPPORT" = "yes"; then > - echo $CPU_BUF_SIZE >$MOUNT/cpu_buffer_size > - else > - echo "cpu-buffer-size not supported - ignored" >&2 > - fi > - fi > - > - if test -n "$ACTIVE_DOMAINS"; then > - if test "$KERNEL_SUPPORT" = "yes"; then > - echo $ACTIVE_DOMAINS >$MOUNT/active_domains > - else > - echo "active-domains not supported - ignored" >&2 > - fi > - fi > - > - if test $NOTE_SIZE != 0; then > - set_param notesize $NOTE_SIZE > - fi > - > - if test "$KERNEL_SUPPORT" = "yes" -a -f $MOUNT/backtrace_depth; then > - set_param backtrace_depth $CALLGRAPH > - elif test "$CALLGRAPH" != "0"; then > - echo "Call-graph profiling not supported - ignored" >&2 > - fi > - > - if test "$IS_TIMER" = 1; then > - return > - fi > - > - if test "$S390_HW_SAMPLER" = "1" -a "$S390_HW_SAMPLER_BUFSIZE" != "0"; then > - echo $S390_HW_SAMPLER_BUFSIZE >$MOUNT/0/hw_sdbt_blocks > - fi > - > - # use the default setup if none set > - if test "$NR_CHOSEN" = 0; then > - set_event 0 $DEFAULT_EVENT > - NR_CHOSEN=1 > - HW_CTRS=`$OPHELP --check-events $DEFAULT_EVENT --callgraph=$CALLGRAPH` > - echo "Using default event: $DEFAULT_EVENT" > - fi > - > - # Necessary in this case : > - # opcontrol ctr0-on ctr1-on then opcontrol ctr0-on > - for f in $OP_COUNTERS ; do > - set_ctr_param $f enabled 0 > - set_ctr_param $f event 0 > - set_ctr_param $f count 0 > - > - if test -f $MOUNT/$f/extra ; then > - set_ctr_param $f extra 0 > - fi > - done > - > - # Check if driver has IBS support > - if test -d $MOUNT/ibs_fetch; then > - # Reset driver's IBS fetch setting > - set_param ibs_fetch/enable 0 > - fi > - > - if test -d $MOUNT/ibs_op ; then > - # Reset driver's IBS op setting > - set_param ibs_op/enable 0 > - fi > - > - verify_counters > - > - OPROFILED_EVENTS= > - for f in `seq 0 $((NR_CHOSEN - 1))`; do > - get_event $f > - if test "$GOTEVENT" != ""; then > - EVENT=`echo $GOTEVENT | awk -F: '{print $1}'` > - EVENT_STR=`$OPHELP $EVENT` > - EVENT_VAL=`echo $EVENT_STR | awk '{print $1}'` > - COUNT=`echo $GOTEVENT | awk -F: '{print $2}'` > - UNIT_MASK=`echo $GOTEVENT | awk -F: '{print $3}'` > - KERNEL=`echo $GOTEVENT | awk -F: '{print $4}'` > - USER=`echo $GOTEVENT | awk -F: '{print $5}'` > - CTR=`echo $HW_CTRS | awk "{print \\$$((f + 1))}"` > - arch_event_validate > - > - if test "$EVENT" = "SPU_CYCLES"; then > - if test "$SEPARATE_KERNEL" = "1"; then > - SEPARATE_KERNEL=0 > - echo "Ignoring --separate=kernel option with SPU_CYCLES" > - fi > - if test "$SEPARATE_LIB" = "0"; then > - SEPARATE_LIB=1 > - echo "Forcing required option --separate=lib with SPU_CYCLES" > - fi > - > - # It is possible for a single application to be > - # running on all SPUs simultaneously. Without > - # SEPARATE_CPU, the resulting sample data would > - # consist of a single sample file. If all SPUs > - # were truly running the same code, the merging > - # of sample data would be fine. However, an > - # application file may have multiple SPU images > - # embedded within it, resulting in different > - # code running on different SPUs. Therefore, > - # we force SEPARATE_CPU in order to properly > - # handle this case. > - if test "$SEPARATE_CPU" = "0"; then > - SEPARATE_CPU=1 > - echo "Forcing required option --separate=cpu with SPU_CYCLES" > - > - fi > - fi > - > - if [ "$CTR" = "ibs_fetch" -o "$CTR" = "ibs_op" ] ; then > - # Handle IBS events setup > - do_param_setup_ibs > - continue > - fi > - > - if test "$EVENT" = "RTC_INTERRUPTS"; then > - set_param rtc_value $COUNT > - $SYSCTL -w dev.oprofile.rtc_value=$COUNT > - else > - set_ctr_param $CTR enabled 1 > - set_ctr_param $CTR event $EVENT_VAL > - loop_count=1 > - for i in ${EVENT_STR}; do > - #Skip first argument of EVENT_STR (event val) since we've already > - #processed that value. > - if test "$loop_count" -gt 1; then > - KEY=`echo $i | awk -F: '{print $1}'` > - VAL=`echo $i | awk -F: '{print $2}'` > - set_ctr_param "" $KEY $VAL > - fi > - loop_count=$((loop_count+1)) > - done > - set_ctr_param $CTR count $COUNT > - set_ctr_param $CTR kernel $KERNEL > - set_ctr_param $CTR user $USER > - set_ctr_param $CTR unit_mask $UNIT_MASK > - > - EXTRA=`$OPHELP --extra-mask $EVENT:$COUNT:$UNIT_MASK_NAMED` > - if test "$EXTRA" -ne 0 ; then > - # A value >= 0x40000 returned by 'ophelp --extra-mask' (EXTRA_MIN_VAL) is interpreted > - # as a valid extra value; otherwise we interpret as a simple unit mask value > - # for a named unit mask with EXTRA_NONE. > - EXTRA_MIN_VAL=262144 > - if test "$EXTRA" -ge $EXTRA_MIN_VAL ; then > - if ! test -f $MOUNT/$CTR/extra ; then > - echo >&2 "Warning: $GOTEVENT has extra mask, but kernel does not support extra field" > - echo >&2 "Please update your kernel or use a different event. Will miscount." > - else > - set_ctr_param $CTR extra $EXTRA > - fi > - else > - UNIT_MASK=$EXTRA > - set_ctr_param $CTR unit_mask $UNIT_MASK > - fi > - fi > - fi > - OPROFILED_EVENTS=${OPROFILED_EVENTS}$EVENT:$EVENT_VAL: > - OPROFILED_EVENTS=${OPROFILED_EVENTS}$CTR:$COUNT:$UNIT_MASK: > - OPROFILED_EVENTS=${OPROFILED_EVENTS}$KERNEL:$USER, > - fi > - done > - > - # For PPC64 architectures we need to set the enable_kernel and > - # enable_user flags for enabling/disabling user/kernel domain > - # profiling. All per-counter user/kernel flags must match. > - # This condition is checked previously by arch_event_validate. > - # This statement uses the last event's user/kernel flags to set > - # /dev/oprofile/enable_kernel and /dev/oprofile/enable_user. > - is_non_cell_ppc64_variant $CPUTYPE > - if test $? -ne 0 ; then > - set_param "enable_kernel" $KERNEL > - set_param "enable_user" $USER > - fi > - > -} > - > - > -do_start_daemon() > -{ > - > - $OPDIR/op-check-perfevents > - if [ "$?" = "0" ]; then > - echo "ATTENTION: Use of opcontrol is discouraged. Please see the man page for operf." > - fi > - > - if test -f "$LOCK_FILE"; then > - kill -0 `cat $LOCK_FILE` 2>/dev/null > - if test "$?" -eq 0; then > - return; > - else > - echo "Detected stale lock file. Removing." >&2 > - rm -f "$LOCK_FILE" > - fi > - fi > - > - do_setup > - check_valid_args > - get_image_range "linux" > - get_image_range "xen" > - do_param_setup > - > - OPD_ARGS=" \ > - --session-dir=$SESSION_DIR \ > - --separate-lib=$SEPARATE_LIB \ > - --separate-kernel=$SEPARATE_KERNEL \ > - --separate-thread=$SEPARATE_THREAD \ > - --separate-cpu=$SEPARATE_CPU" > - > - if test "$IS_TIMER" = 1; then > - OPD_ARGS="$OPD_ARGS --events=" > - else > - if ! test -z "$OPROFILED_EVENTS"; then > - OPD_ARGS="$OPD_ARGS --events=$OPROFILED_EVENTS" > - fi > - fi > - > - if test "$VMLINUX" = "none"; then > - OPD_ARGS="$OPD_ARGS --no-vmlinux" > - else > - OPD_ARGS="$OPD_ARGS --vmlinux=$VMLINUX --kernel-range=$KERNEL_RANGE" > - fi > - > - if ! test "$XENIMAGE" = "none"; then > - OPD_ARGS="$OPD_ARGS --xen-image=$XENIMAGE --xen-range=$XEN_RANGE" > - fi > - > - if ! test -z "$IMAGE_FILTER"; then > - OPD_ARGS="$OPD_ARGS --image=$IMAGE_FILTER" > - fi > - > - if test -n "$VERBOSE"; then > - OPD_ARGS="$OPD_ARGS --verbose=$VERBOSE" > - fi > - > - help_start_daemon_with_ibs > - > - vecho "executing oprofiled $OPD_ARGS" > - > - $OPROFILED $OPD_ARGS > - > - COUNT=0 > - while ! test -f "$SESSION_DIR/lock" > - do > - sleep 1 > - COUNT=`expr $COUNT + 1` > - if test "$COUNT" -eq 10; then > - echo "Couldn't start oprofiled." >&2 > - echo "Check the log file \"$LOG_FILE\" and kernel syslog" >&2 > - exit 1 > - fi > - done > - > - echo "Daemon started." > -} > - > -do_start() > -{ > - prep_jitdump; > - if test "$KERNEL_SUPPORT" = "yes"; then > - echo 1 >$MOUNT/enable > - fi > - kill -USR1 `cat $LOCK_FILE` 2>/dev/null > - echo "Profiler running." > -} > - > - > -# print status > -do_status() > -{ > - OPROFILED_PID=`cat $SESSION_DIR/lock 2>/dev/null` > - if test -n "$OPROFILED_PID" -a -d "/proc/$OPROFILED_PID"; then > - if test "$KERNEL_SUPPORT" = yes \ > - && test 0 != $(cat /dev/oprofile/enable); then > - echo "Daemon running: pid $OPROFILED_PID" > - else > - echo "Daemon paused: pid $OPROFILED_PID" > - fi > - else > - echo "Daemon not running" > - fi > - echo "Session-dir: $SESSION_DIR" > - > - if test "$NR_CHOSEN" != "0"; then > - for f in `seq 0 $((NR_CHOSEN - 1))`; do > - get_event $f > - echo "Event $f: $GOTEVENT" > - done > - fi > - > - SEPARATE="" > - if test "$SEPARATE_LIB" = "1"; then > - SEPARATE="library"; > - fi > - if test "$SEPARATE_KERNEL" = "1"; then > - SEPARATE="$SEPARATE kernel"; > - fi > - if test "$SEPARATE_THREAD" = "1"; then > - SEPARATE="$SEPARATE thread"; > - fi > - if test "$SEPARATE_CPU" = "1"; then > - SEPARATE="$SEPARATE cpu"; > - fi > - > - if test -z "$SEPARATE"; then > - SEPARATE=none > - fi > - > - echo "Separate options: $SEPARATE" > - echo "vmlinux file: $VMLINUX" > - > - if test -z "$IMAGE_FILTER"; then > - echo "Image filter: none" > - else > - echo "Image filter: $IMAGE_FILTER" > - fi > - > - echo "Call-graph depth: $CALLGRAPH" > - if test "$BUF_SIZE" != "0"; then > - echo "Buffer size: $BUF_SIZE" > - fi > - if test "$KERNEL_SUPPORT" != "yes"; then > - if test "$NOTE_SIZE" != "0"; then > - echo "Note buffer size: $NOTE_SIZE" > - fi > - else > - if test "$BUF_WATERSHED" != "0"; then > - echo "CPU buffer watershed: $BUF_WATERSHED" > - fi > - if test "$CPU_BUF_SIZE" != "0"; then > - echo "CPU buffer size: $CPU_BUF_SIZE" > - fi > - fi > - if test "$S390_HW_SAMPLER" = "1"; then > - echo -n "System z hardware sampling buffer size (in 2MB areas): " > - if test "$S390_HW_SAMPLER_BUFSIZE" = "0"; then > - cat $MOUNT/0/hw_sdbt_blocks > - else > - echo "$S390_HW_SAMPLER_BUFSIZE" > - fi > - fi > - > - exit 0 > -} > - > - > -# do_dump_data > -# returns 0 if successful > -# returns 1 if the daemon is unable to dump data > -# exit 1 if we need to be root to dump > -do_dump_data() > -{ > - # make sure that the daemon is not dead and gone > - if test -e "$SESSION_DIR/lock"; then > - OPROFILED_PID=`cat $SESSION_DIR/lock` > - if test ! -d "/proc/$OPROFILED_PID"; then > - echo "dump fail: daemon died during last run ?" >&2 > - return 1; > - fi > - else > - return 1; > - fi > - > - if test "$KERNEL_SUPPORT" = "yes"; then > - if ! test -w $MOUNT/dump; then > - if test `id -u` != "0"; then > - echo "You must be root to dump with this kernel version" > - exit 1 > - fi > - fi > - # trigger oprofiled to execute opjitconv > - if test -p "$SESSION_DIR/opd_pipe"; then > - echo do_jitconv >> $SESSION_DIR/opd_pipe > - fi > - rm -f "$SESSION_DIR/complete_dump" > - echo 1 > $MOUNT/dump > - # loop until the complete_dump file is created to > - # signal that the dump has been completed > - while [ \( ! -e "$SESSION_DIR/complete_dump" \) ] > - do > - if test ! -d "/proc/$OPROFILED_PID"; then > - echo "dump fail: either daemon died during last run or dies during dump" >&2 > - return 1 > - fi > - sleep 1; > - done > - else > - echo 1 > $MOUNT/dump > - # HACK ! > - sleep 2 > - fi > - cp -r /dev/oprofile/stats "$SAMPLES_DIR/current" > - > - return 0; > -} > - > - > -# do_dump > -# returns 0 if successful > -# exits if unsuccessful > -do_dump() > -{ > - do_dump_data > - if test $? -ne 0 -a "$ONLY_DUMP" = "yes"; then > - echo "Unable to complete dump of oprofile data: is the oprofile daemon running?" >& 2 > - exit 1; > - fi > - return 0; > -} > - > -# tell daemon to re-open the sample files > -hup_daemon() > -{ > - if test -f "$LOCK_FILE"; then > - echo -n "Signalling daemon... " > - kill -HUP `cat $LOCK_FILE` > - echo "done" > - fi > -} > - > - > -# move all the sample files to a sample directory > -do_save_session() > -{ > - SAVE_DIR="${SAMPLES_DIR}/${SAVE_NAME}" > - > - if test -e "$SAVE_DIR"; then > - echo "session $SAVE_DIR already exists" >&2 > - exit 1 > - fi > - > - if ! test -e $CURRENT_SAMPLES_DIR; then > - echo "$CURRENT_SAMPLES_DIR doesn't exist: nothing to save" >&2 > - exit 0 > - fi > - > - # FIXME: I don't think it's worth checking for empty current directory > - > - mv $CURRENT_SAMPLES_DIR $SAVE_DIR > - if test "$?" != "0"; then > - echo "Couldn't move $CURRENT_SAMPLES_DIR to $SAVE_DIR" >&2 > - exit 1 > - fi > - > - hup_daemon > -} > - > - > -# remove all the sample files > -do_reset() > -{ > - if test -z "$SAMPLES_DIR"; then > - echo "opcontrol:do_reset() SAMPLES_DIR is empty!" > - exit 1; > - fi > - > - # daemon use {kern} and {root} subdir, it's not a typo to not use ${} > - move_and_remove $SAMPLES_DIR/current/{kern} > - move_and_remove $SAMPLES_DIR/current/{root} > - move_and_remove $SAMPLES_DIR/current/stats > - > - # clear temp directory for jitted code > - prep_jitdump; > - > - hup_daemon > -} > - > - > -do_deinit() > -{ > - # unmount /dev/oprofile if it is mounted > - OPROF_FS=`grep /dev/oprofile /proc/mounts` > - if test -n "$OPROF_FS"; then > - umount /dev/oprofile > - fi > - # unload the oprofile module if it is around > - OPROF_MOD=`lsmod | grep oprofile` > - if test -n "$OPROF_MOD"; then > - echo "Unloading oprofile module" >& 2 > - rmmod oprofile > - fi > -} > - > - > -# The function that calls the appropriate operations > -do_operations() > -{ > - # INIT always done by load_module to get access to cputype > - # thus INIT is a noop > - > - if test "$STATUS" = "yes"; then > - do_status > - fi > - > - if test "$SETUP" = "yes"; then > - check_valid_args > - do_save_setup > - fi > - > - if test "$START_DAEMON" = "yes"; then > - do_start_daemon > - fi > - > - if test "$START" = "yes"; then > - do_start_daemon > - do_start > - fi > - > - if test "$DUMP" = "yes"; then > - do_dump > - fi > - > - if test "$SAVE_SESSION" = "yes"; then > - do_save_session > - fi > - > - if test "$STOP" = "yes"; then > - do_stop > - fi > - > - if test "$KILL_DAEMON" = "yes"; then > - do_kill_daemon > - fi > - > - if test "$RESET" = "yes"; then > - do_reset > - fi > - > - if test "$DEINIT" = "yes"; then > - do_deinit > - fi > -} > - > -# early check for --version, --help and --session-dir > -check_options_early() > -{ > - > - OPHELP="$OPDIR/ophelp" > - > - for i in $@; do > - # added to handle arg=val parameters > - arg=`printf %s $i | awk -F= '{print $1}'` > - val=`printf %s $i | awk -F= '{print $2}'` > - case "$arg" in > - -\?|--help) > - do_help > - exit 0 > - ;; > - > - -v|--version) > - echo -n "`basename $0`: " > - $OPHELP --version | cut -d' ' -f2- > - exit 0 > - ;; > - --session-dir) > - error_if_invalid_arg "$arg" "$val" > - SESSION_DIR="$val" > - DO_SETUP=yes > - # do not exit early > - ;; > - > - esac > - done > -} > - > - > -# determine which module is loaded > -check_version() > -{ > - OPROFILE_AVAILABLE=no > - grep oprofilefs /proc/mounts >/dev/null > - if test "$?" -eq 0; then > - # need to have oprofilefs mounted for this to work on 2.6 > - KERNEL_SUPPORT=yes > - OPROFILE_AVAILABLE=yes > - return > - fi > - # need to have /proc/oprof available for this to work on 2.4 > - grep oprof /proc/devices >/dev/null > - if test "$?" -eq 0; then > - KERNEL_SUPPORT=no > - OPROFILE_AVAILABLE=yes > - return > - fi > -} > - > -# error out if the module is not loaded > -check_oprofile_available() > -{ > - if test "$OPROFILE_AVAILABLE" != "yes"; then > - echo "Kernel support not available, missing opcontrol --init as root ?" > - exit 1 > - fi > -} > - > - > -try_reset_sample_file() > -{ > - # special case to avoid loading the module, it works only if the > - # daemon is not running because --reset imply --dump. Rather to check > - # if the daemon is running we check if the module is loaded because > - # we are only trying to avoid its load, if the check fails we fallback > - # to the normal dump / reset sequence. > - if test -z "$2" -a "$1" = "--reset"; then > - check_version > - if test "$OPROFILE_AVAILABLE" != "yes"; then > - do_init_daemon_vars > - do_reset > - exit 0 > - fi > - fi > -} > - > -# > -# Begin IBS Specific Functions > -# > -verify_ibs() > -{ > - IBS_EVENT=`echo $1| awk -F: '{print $1}'` > - IBS_COUNT=`echo $1 | awk -F: '{print $2}'` > - IBS_MASK=`echo $1 | awk -F: '{print $3}'` > - > - IBS_TYPE=`$OPHELP --check-events $1` > - if test "$?" != "0" ; then > - exit 1 > - fi > - > - if [ "$IBS_TYPE" = "ibs_fetch " ] ; then > - # Check IBS_COUNT consistency > - if test "$IBS_FETCH_COUNT" = "0" ; then > - IBS_FETCH_COUNT=$IBS_COUNT > - IBS_FETCH_MASK=$IBS_MASK > - elif test "$IBS_FETCH_COUNT" != "$IBS_COUNT" ; then > - echo "ERROR: All IBS Fetch must have the same count." > - exit 1 > - fi > - > - # Check IBS_MASK consistency > - if test "$IBS_FETCH_MASK" != "$IBS_MASK" ; then > - echo "ERROR: All IBS Fetch must have the same unitmask." > - exit 1 > - fi > - > - # Check IBS_FETCH_COUNT within range > - if test "$IBS_FETCH_COUNT" -gt 1048575 ; then > - echo "ERROR: IBS Fetch count is too large." > - echo " The maximum IBS-fetch count is 1048575." > - exit 1 > - fi > - > - elif [ "$IBS_TYPE" = "ibs_op " ] ; then > - # Check IBS_COUNT consistency > - if test "$IBS_OP_COUNT" = "0" ; then > - IBS_OP_COUNT=$IBS_COUNT > - IBS_OP_MASK=$IBS_MASK > - elif test "$IBS_OP_COUNT" != "$IBS_COUNT" ; then > - echo "All IBS Op must have the same count." > - exit 1 > - fi > - > - # Check IBS_MASK consistency > - if test "$IBS_OP_MASK" != "$IBS_MASK" ; then > - echo "All IBS Op must have the same unitmask." > - exit 1 > - fi > - > - # Check IBS_OP_COUNT within range > - case "$CPUTYPE" in > - x86-64/family10) > - if test "$IBS_OP_COUNT" -gt 1048575 ; then > - echo "ERROR: IBS Op count is too large." > - echo " The maximum IBS-fetch count is 1048575." > - exit 1 > - fi > - ;; > - > - x86-64/family12h|\ > - x86-64/family14h|\ > - x86-64/family15h) > - if test "$IBS_OP_COUNT" -gt 134217727 ; then > - echo "ERROR: IBS Op count is too large." > - echo " The maximum IBS-Op count is 134217727." > - exit 1 > - fi > - ;; > - *) > - esac > - fi > - > - return > -} > - > - > -do_param_setup_ibs() > -{ > - if test "$KERNEL_SUPPORT" != "yes" ; then > - echo "ERROR: No kernel support for IBS profiling." > - exit 1 > - fi > - > - # Check if driver has IBS support > - if test ! -d $MOUNT/ibs_fetch -o ! -d $MOUNT/ibs_op ; then > - echo "ERROR: No kernel support for IBS profiling." > - exit 1 > - fi > - > - if test `echo $EVENT | \ > - awk '{ print substr($0, 1, 10)}'` = "IBS_FETCH_" ; then > - if test "$COUNT" != "0"; then > - if [ "$IBS_FETCH_EVENTS" = "" ] ; then > - IBS_FETCH_EVENTS="$EVENT" > - else > - IBS_FETCH_EVENTS="$IBS_FETCH_EVENTS,$EVENT" > - fi > - IBS_FETCH_COUNT=$COUNT > - set_param ibs_fetch/max_count $COUNT > - set_param ibs_fetch/rand_enable 1 > - set_param ibs_fetch/enable 1 > - else > - set_param ibs_fetch/enable 0 > - fi > - > - elif test `echo $EVENT | \ > - awk '{ print substr($0, 1, 7)}'` = "IBS_OP_" ; then > - if test "$COUNT" != "0"; then > - if [ "$IBS_OP_EVENTS" = "" ] ; then > - IBS_OP_EVENTS="$EVENT" > - else > - IBS_OP_EVENTS="$IBS_OP_EVENTS,$EVENT" > - fi > - IBS_OP_COUNT=$COUNT > - IBS_OP_UNITMASK=$UNIT_MASK > - > - set_param ibs_op/max_count $COUNT > - set_param ibs_op/enable 1 > - > - # NOTE: We default to use dispatched_op if available. > - # Some of the older family10 system does not have > - # dispatched_ops feature. > - # Dispatched op is enabled by bit 0 of the unitmask > - IBS_OP_DISPATCHED_OP=$(( IBS_OP_UNITMASK & 0x1 )) > - if test -f $MOUNT/ibs_op/dispatched_ops ; then > - set_param ibs_op/dispatched_ops $IBS_OP_DISPATCHED_OP > - else > - if test $IBS_OP_DISPATCHED_OP -eq 1 ; then > - echo "ERROR: IBS Op dispatched ops is not supported." > - exit 1 > - fi > - fi > - > - # NOTE: BTA is enabled by bit 2 of the unitmask > - IBS_OP_BTA=$(( IBS_OP_UNITMASK & 0x4 )) > - if test -f $MOUNT/ibs_op/branch_target; then > - if [ "$IBS_OP_BTA" = "4" ] ; then > - set_param ibs_op/branch_target 1 > - else > - set_param ibs_op/branch_target 0 > - fi > - > - # TODO: Check if write successful > - else > - if test $IBS_OP_BTA -eq 1 ; then > - echo "ERROR: IBS Op Branch Target Address is not supported." > - exit 1 > - fi > - fi > - else > - set_param ibs_op/enable 0 > - fi > - fi > -} > - > - > -help_start_daemon_with_ibs() > -{ > - if test "$IBS_FETCH_COUNT" != "0" -o "$IBS_OP_COUNT" != "0" ; then > - OPD_ARGS="${OPD_ARGS} --ext-feature=ibs:" > - if test "$IBS_FETCH_COUNT" != "0"; then > - OPD_ARGS="${OPD_ARGS}fetch:$IBS_FETCH_EVENTS:$IBS_FETCH_COUNT:$IBS_FETCH_UNITMASK|" > - fi > - > - if test "$IBS_OP_COUNT" != "0"; then > - OPD_ARGS="${OPD_ARGS}op:$IBS_OP_EVENTS:$IBS_OP_COUNT:$IBS_OP_UNITMASK" > - fi > - fi > -} > - > -# > -# End IBS Specific Functions > -# > - > -# main > - > -# determine the location of opcontrol and related programs > -if test -z "$OPDIR"; then > - BINDIR="/usr/bin" > - OPCONTROL=`$BINDIR/which $0` > - OPDIR=`$BINDIR/dirname $OPCONTROL` > -fi > - > -PATH=$OPDIR:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin > - > -check_options_early $@ > - > -if test -z "$1"; then > - do_help > - exit 0 > -fi > - > -if test `id -u` = "0"; then > - try_reset_sample_file $@ > - > - load_module > -fi > -check_version > - > -# Except --reset, even the few operations allowed as non root needs the > -# kernel support, if we don't error out now the error message will be obscure > -check_oprofile_available > - > -do_init > -if test `id -u` != "0"; then > - if test -z "$2"; then > - case "$1" in > - --dump|-d) > - ONLY_DUMP=yes > - do_dump > - exit 0; > - ;; > - --list-events|-l) > - exec $OPHELP > - exit 0; > - ;; > - *) > - echo "Normal users are limited to either '--dump' or '--list-events'." >&2 > - exit 1 > - ;; > - esac > - else > - echo "Normal users are limited to either '--dump' or '--list-events'." >&2 > - exit 1 > - fi > -fi > - > -do_options $@ > -do_operations > diff --git a/utils/ophelp.c b/utils/ophelp.c > index 980c6dc..c129ea5 100644 > --- a/utils/ophelp.c > +++ b/utils/ophelp.c > @@ -51,17 +51,6 @@ static size_t hweight(size_t mask) > return count; > } > > -static void do_arch_specific_event_help(struct op_event * event) > -{ > - switch (cpu_type) { > - case CPU_PPC64_CELL: > - printf("Group %u :", event->val / 100); > - break; > - default: > - break; > - } > -} > - > #define LINE_LEN 99 > > static void word_wrap(int indent, int *column, char *msg) > @@ -96,7 +85,6 @@ static void help_for_event(struct op_event * event) > size_t nr_counters; > char buf[32]; > > - do_arch_specific_event_help(event); > nr_counters = op_get_nr_counters(cpu_type); > > /* Sanity check */ > @@ -273,10 +261,7 @@ static void resolve_events(void) > else > printf("N/A "); > else > - if (strcmp(selected_events[i]->name, TIMER_EVENT_NAME) == 0) > - printf("timer "); > - else > - printf("%d ", (unsigned int) counter_map[i]); > + printf("%d ", (unsigned int) counter_map[i]); > printf("\n"); > > free(counter_map); > @@ -451,10 +436,10 @@ int main(int argc, char const * argv[]) > > if (cpu_type == CPU_TIMER_INT) { > if (!check_events) { > - printf("Using timer interrupt.\n" > - "Timer mode is only supported by 'opcontrol'. If you intend to use operf or\n" > - "ocount, you must first ensure the oprofile kernel module is unloaded\n" > - "(using 'opcontrol --deinit'); then try the operation again.\n"); > + printf("CPU type 'timer' was detected, but this is no longer a supported mode for oprofile.\n" > + "Ensure the obsolete opcontrol profiler (available in earlier oprofile releases)\n" > + "is not running on the system. To check for this, look for the 'oprofiled'\n" > + "process using the 'ps' command."); > } > exit(EXIT_SUCCESS); > } > @@ -573,17 +558,6 @@ int main(int argc, char const * argv[]) > "This is a limited set of fallback events because oprofile doesn't know your CPU\n"; > break; > > - case CPU_IA64: > - case CPU_IA64_1: > - case CPU_IA64_2: > - event_doc = > - "See Intel Itanium Processor Reference Manual\n" > - "for Software Development (Document 245320-003),\n" > - "Intel Itanium Processor Reference Manual\n" > - "for Software Optimization (Document 245473-003),\n" > - "Intel Itanium 2 Processor Reference Manual\n" > - "for Software Development and Optimization (Document 251110-001)\n\n"; > - break; > case CPU_AXP_EV4: > case CPU_AXP_EV5: > case CPU_AXP_PCA56: > @@ -676,12 +650,6 @@ int main(int argc, char const * argv[]) > "Cortex A57 DDI (ARM DDI 0500D, revision r0p2)\n"; > break; > > - case CPU_PPC64_PA6T: > - event_doc = > - "See PA6T Power Implementation Features Book IV\n" > - "Chapter 7 Performance Counters\n"; > - break; > - > case CPU_PPC64_POWER4: > case CPU_PPC64_POWER5: > case CPU_PPC64_POWER6: > @@ -690,7 +658,6 @@ int main(int argc, char const * argv[]) > case CPU_PPC64_970: > case CPU_PPC64_970MP: > case CPU_PPC64_POWER7: > - case CPU_PPC64_IBM_COMPAT_V1: > event_doc = > "When using operf, events may be specified without a '_GRP<n>' suffix.\n" > "If _GRP<n> (i.e., group number) is not specified, one will be automatically\n" > @@ -708,12 +675,6 @@ int main(int argc, char const * argv[]) > "See Power ISA 2.07 at https://www.power.org/\n\n"; > break; > > - case CPU_PPC64_CELL: > - event_doc = > - "Obtain Cell Broadband Engine documentation at:\n" > - "http://www-306.ibm.com/chips/techlib/techlib.nsf/products/Cell_Broadband_Engine\n"; > - break; > - > case CPU_MIPS_20K: > event_doc = > "See Programming the MIPS64 20Kc Processor Core User's " > @@ -806,14 +767,6 @@ int main(int argc, char const * argv[]) > "Downloadable from http://www.freescale.com\n"; > break; > > - case CPU_AVR32: > - event_doc = > - "See AVR32 Architecture Manual\n" > - "Chapter 6: Performance Counters\n" > - "http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf\n"; > - > - break; > - > case CPU_TILE_TILE64: > case CPU_TILE_TILEPRO: > case CPU_TILE_TILEGX: > @@ -828,20 +781,17 @@ int main(int argc, char const * argv[]) > case CPU_S390_Z196: > case CPU_S390_ZEC12: > event_doc = "IBM System z CPU Measurement Facility\n" > - "http://www-01.ibm.com/support/docview.wss" > - "?uid=isg26fcd1cc32246f4c8852574ce0044734a\n"; > + "http://www-01.ibm.com/support/docview.wss" > + "?uid=isg26fcd1cc32246f4c8852574ce0044734a\n"; > break; > > - case CPU_RTC: > - break; > - > - // don't use default, if someone add a cpu he wants a compiler warning > - // if he forgets to handle it here. > - case CPU_TIMER_INT: > - case CPU_NO_GOOD: > - case MAX_CPU_TYPE: > - printf("%d is not a valid processor type.\n", cpu_type); > - exit(EXIT_FAILURE); > + // don't use default, if someone add a cpu he wants a compiler warning > + // if he forgets to handle it here. > + case CPU_TIMER_INT: > + case CPU_NO_GOOD: > + case MAX_CPU_TYPE: > + printf("%d is not a valid processor type.\n", cpu_type); > + exit(EXIT_FAILURE); > } > > sprintf(title, "oprofile: available events for CPU type \"%s\"\n\n", pretty); > @@ -850,7 +800,7 @@ int main(int argc, char const * argv[]) > else { > printf("%s%s", title, event_doc); > printf("For architectures using unit masks, you may be able to specify\n" > - "unit masks by name. See 'opcontrol' or 'operf' man page for more details.\n\n"); > + "unit masks by name. See 'operf' or 'ocount' man page for more details.\n\n"); > } > > list_for_each(pos, events) { ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk