1
0
mirror of https://github.com/ioacademy-jikim/debugging synced 2026-08-30 01:09:34 +00:00

first commit

This commit is contained in:
jikim
2015-12-13 22:34:58 +09:00
commit 0b589c7986
9455 changed files with 4350134 additions and 0 deletions
@@ -0,0 +1,36 @@
cachegrind_x86_linux-cg_arch.o: cg_arch.c /usr/include/stdc-predef.h \
../include/pub_tool_basics.h ../VEX/pub/libvex_basictypes.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h \
../include/pub_tool_libcassert.h ../include/pub_tool_basics.h \
../include/pub_tool_libcbase.h ../include/pub_tool_libcprint.h \
../include/pub_tool_options.h ../VEX/pub/libvex.h \
../VEX/pub/libvex_basictypes.h ../VEX/pub/libvex_ir.h \
../include/pub_tool_machine.h cg_arch.h
/usr/include/stdc-predef.h:
../include/pub_tool_basics.h:
../VEX/pub/libvex_basictypes.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h:
../include/pub_tool_libcassert.h:
../include/pub_tool_basics.h:
../include/pub_tool_libcbase.h:
../include/pub_tool_libcprint.h:
../include/pub_tool_options.h:
../VEX/pub/libvex.h:
../VEX/pub/libvex_basictypes.h:
../VEX/pub/libvex_ir.h:
../include/pub_tool_machine.h:
cg_arch.h:
@@ -0,0 +1,115 @@
cachegrind_x86_linux-cg_main.o: cg_main.c /usr/include/stdc-predef.h \
../include/pub_tool_basics.h ../VEX/pub/libvex_basictypes.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h \
../include/pub_tool_debuginfo.h ../include/pub_tool_basics.h \
../include/pub_tool_xarray.h ../include/pub_tool_libcbase.h \
../include/pub_tool_libcassert.h ../include/pub_tool_libcfile.h \
../include/pub_tool_vki.h ../include/vki/vki-linux.h \
../include/vki/vki-posixtypes-x86-linux.h ../include/vki/vki-x86-linux.h \
../include/vki/vki-linux-drm.h ../include/vki/vki-xen.h \
../include/vki/vki-xen-x86.h ../include/vki/vki-xen-domctl.h \
../include/vki/vki-xen-sysctl.h ../include/vki/vki-xen-mmuext.h \
../include/vki/vki-xen-schedop.h ../include/vki/vki-xen-memory.h \
../include/vki/vki-xen-evtchn.h ../include/vki/vki-xen-gnttab.h \
../include/vki/vki-xen-version.h ../include/vki/vki-xen-hvm.h \
../include/vki/vki-xen-tmem.h ../include/vki/vki-xen-xsm.h \
../include/vki/vki-xen-physdev.h ../include/pub_tool_libcprint.h \
../include/pub_tool_libcproc.h ../include/pub_tool_mallocfree.h \
../include/pub_tool_options.h ../VEX/pub/libvex.h \
../VEX/pub/libvex_basictypes.h ../VEX/pub/libvex_ir.h \
../include/pub_tool_oset.h ../include/pub_tool_tooliface.h \
../include/pub_tool_errormgr.h ../include/pub_tool_execontext.h \
../include/pub_tool_xarray.h ../include/pub_tool_clientstate.h \
../include/pub_tool_machine.h cg_arch.h cg_sim.c cg_branchpred.c
/usr/include/stdc-predef.h:
../include/pub_tool_basics.h:
../VEX/pub/libvex_basictypes.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h:
../include/pub_tool_debuginfo.h:
../include/pub_tool_basics.h:
../include/pub_tool_xarray.h:
../include/pub_tool_libcbase.h:
../include/pub_tool_libcassert.h:
../include/pub_tool_libcfile.h:
../include/pub_tool_vki.h:
../include/vki/vki-linux.h:
../include/vki/vki-posixtypes-x86-linux.h:
../include/vki/vki-x86-linux.h:
../include/vki/vki-linux-drm.h:
../include/vki/vki-xen.h:
../include/vki/vki-xen-x86.h:
../include/vki/vki-xen-domctl.h:
../include/vki/vki-xen-sysctl.h:
../include/vki/vki-xen-mmuext.h:
../include/vki/vki-xen-schedop.h:
../include/vki/vki-xen-memory.h:
../include/vki/vki-xen-evtchn.h:
../include/vki/vki-xen-gnttab.h:
../include/vki/vki-xen-version.h:
../include/vki/vki-xen-hvm.h:
../include/vki/vki-xen-tmem.h:
../include/vki/vki-xen-xsm.h:
../include/vki/vki-xen-physdev.h:
../include/pub_tool_libcprint.h:
../include/pub_tool_libcproc.h:
../include/pub_tool_mallocfree.h:
../include/pub_tool_options.h:
../VEX/pub/libvex.h:
../VEX/pub/libvex_basictypes.h:
../VEX/pub/libvex_ir.h:
../include/pub_tool_oset.h:
../include/pub_tool_tooliface.h:
../include/pub_tool_errormgr.h:
../include/pub_tool_execontext.h:
../include/pub_tool_xarray.h:
../include/pub_tool_clientstate.h:
../include/pub_tool_machine.h:
cg_arch.h:
cg_sim.c:
cg_branchpred.c:
@@ -0,0 +1,125 @@
cg_merge-cg_merge.o: cg_merge.c /usr/include/stdc-predef.h \
/usr/include/stdio.h /usr/include/features.h \
/usr/include/i386-linux-gnu/sys/cdefs.h \
/usr/include/i386-linux-gnu/bits/wordsize.h \
/usr/include/i386-linux-gnu/gnu/stubs.h \
/usr/include/i386-linux-gnu/gnu/stubs-32.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stddef.h \
/usr/include/i386-linux-gnu/bits/types.h \
/usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h \
/usr/include/i386-linux-gnu/bits/stdio_lim.h \
/usr/include/i386-linux-gnu/bits/sys_errlist.h \
/usr/include/i386-linux-gnu/bits/stdio.h \
/usr/include/i386-linux-gnu/bits/stdio2.h /usr/include/stdlib.h \
/usr/include/i386-linux-gnu/bits/waitflags.h \
/usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
/usr/include/i386-linux-gnu/bits/endian.h \
/usr/include/i386-linux-gnu/bits/byteswap.h \
/usr/include/i386-linux-gnu/bits/byteswap-16.h \
/usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \
/usr/include/i386-linux-gnu/sys/select.h \
/usr/include/i386-linux-gnu/bits/select.h \
/usr/include/i386-linux-gnu/bits/sigset.h \
/usr/include/i386-linux-gnu/bits/time.h \
/usr/include/i386-linux-gnu/bits/select2.h \
/usr/include/i386-linux-gnu/sys/sysmacros.h \
/usr/include/i386-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h \
/usr/include/i386-linux-gnu/bits/stdlib-float.h \
/usr/include/i386-linux-gnu/bits/stdlib.h /usr/include/assert.h \
/usr/include/string.h /usr/include/xlocale.h \
/usr/include/i386-linux-gnu/bits/string.h \
/usr/include/i386-linux-gnu/bits/string2.h \
/usr/include/i386-linux-gnu/bits/string3.h /usr/include/ctype.h
/usr/include/stdc-predef.h:
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/i386-linux-gnu/sys/cdefs.h:
/usr/include/i386-linux-gnu/bits/wordsize.h:
/usr/include/i386-linux-gnu/gnu/stubs.h:
/usr/include/i386-linux-gnu/gnu/stubs-32.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stddef.h:
/usr/include/i386-linux-gnu/bits/types.h:
/usr/include/i386-linux-gnu/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h:
/usr/include/i386-linux-gnu/bits/stdio_lim.h:
/usr/include/i386-linux-gnu/bits/sys_errlist.h:
/usr/include/i386-linux-gnu/bits/stdio.h:
/usr/include/i386-linux-gnu/bits/stdio2.h:
/usr/include/stdlib.h:
/usr/include/i386-linux-gnu/bits/waitflags.h:
/usr/include/i386-linux-gnu/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/i386-linux-gnu/bits/endian.h:
/usr/include/i386-linux-gnu/bits/byteswap.h:
/usr/include/i386-linux-gnu/bits/byteswap-16.h:
/usr/include/i386-linux-gnu/sys/types.h:
/usr/include/time.h:
/usr/include/i386-linux-gnu/sys/select.h:
/usr/include/i386-linux-gnu/bits/select.h:
/usr/include/i386-linux-gnu/bits/sigset.h:
/usr/include/i386-linux-gnu/bits/time.h:
/usr/include/i386-linux-gnu/bits/select2.h:
/usr/include/i386-linux-gnu/sys/sysmacros.h:
/usr/include/i386-linux-gnu/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:
/usr/include/i386-linux-gnu/bits/stdlib-float.h:
/usr/include/i386-linux-gnu/bits/stdlib.h:
/usr/include/assert.h:
/usr/include/string.h:
/usr/include/xlocale.h:
/usr/include/i386-linux-gnu/bits/string.h:
/usr/include/i386-linux-gnu/bits/string2.h:
/usr/include/i386-linux-gnu/bits/string3.h:
/usr/include/ctype.h:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,90 @@
include $(top_srcdir)/Makefile.tool.am
EXTRA_DIST = \
docs/cg-manual.xml \
docs/cg_annotate-manpage.xml \
docs/cg_diff-manpage.xml \
docs/cg_merge-manpage.xml
#----------------------------------------------------------------------------
# Headers, etc
#----------------------------------------------------------------------------
bin_SCRIPTS = cg_annotate cg_diff
noinst_HEADERS = \
cg_arch.h \
cg_branchpred.c \
cg_sim.c
#----------------------------------------------------------------------------
# cg_merge (built for the primary target only)
#----------------------------------------------------------------------------
bin_PROGRAMS = cg_merge
cg_merge_SOURCES = cg_merge.c
cg_merge_CPPFLAGS = $(AM_CPPFLAGS_PRI)
cg_merge_CFLAGS = $(AM_CFLAGS_PRI)
cg_merge_CCASFLAGS = $(AM_CCASFLAGS_PRI)
cg_merge_LDFLAGS = $(AM_CFLAGS_PRI)
# If there is no secondary platform, and the platforms include x86-darwin,
# then the primary platform must be x86-darwin. Hence:
if ! VGCONF_HAVE_PLATFORM_SEC
if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
cg_merge_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
endif
endif
#----------------------------------------------------------------------------
# cachegrind-<platform>
#----------------------------------------------------------------------------
noinst_PROGRAMS = cachegrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@
if VGCONF_HAVE_PLATFORM_SEC
noinst_PROGRAMS += cachegrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@
endif
CACHEGRIND_SOURCES_COMMON = \
cg_main.c \
cg_arch.c
cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \
$(CACHEGRIND_SOURCES_COMMON)
cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \
$(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \
$(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \
$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@)
cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \
$(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@)
cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \
$(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LINK = \
$(top_builddir)/coregrind/link_tool_exe_@VGCONF_OS@ \
@VALT_LOAD_ADDRESS_PRI@ \
$(LINK) \
$(cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS) \
$(cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS)
if VGCONF_HAVE_PLATFORM_SEC
cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = \
$(CACHEGRIND_SOURCES_COMMON)
cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \
$(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \
$(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \
$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@)
cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \
$(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@)
cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \
$(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LINK = \
$(top_builddir)/coregrind/link_tool_exe_@VGCONF_OS@ \
@VALT_LOAD_ADDRESS_SEC@ \
$(LINK) \
$(cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS) \
$(cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS)
endif
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -0,0 +1,911 @@
#! /usr/bin/perl
##--------------------------------------------------------------------##
##--- Cachegrind's annotator. cg_annotate.in ---##
##--------------------------------------------------------------------##
# This file is part of Cachegrind, a Valgrind tool for cache
# profiling programs.
#
# Copyright (C) 2002-2015 Nicholas Nethercote
# njn@valgrind.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307, USA.
#
# The GNU General Public License is contained in the file COPYING.
#----------------------------------------------------------------------------
# The file format is simple, basically printing the cost centre for every
# source line, grouped by files and functions. The details are in
# Cachegrind's manual.
#----------------------------------------------------------------------------
# Performance improvements record, using cachegrind.out for cacheprof, doing no
# source annotation (irrelevant ones removed):
# user time
# 1. turned off warnings in add_hash_a_to_b() 3.81 --> 3.48s
# [now add_array_a_to_b()]
# 6. make line_to_CC() return a ref instead of a hash 3.01 --> 2.77s
#
#10. changed file format to avoid file/fn name repetition 2.40s
# (not sure why higher; maybe due to new '.' entries?)
#11. changed file format to drop unnecessary end-line "."s 2.36s
# (shrunk file by about 37%)
#12. switched from hash CCs to array CCs 1.61s
#13. only adding b[i] to a[i] if b[i] defined (was doing it if
# either a[i] or b[i] was defined, but if b[i] was undefined
# it just added 0) 1.48s
#14. Stopped converting "." entries to undef and then back 1.16s
#15. Using foreach $i (x..y) instead of for ($i = 0...) in
# add_array_a_to_b() 1.11s
#
# Auto-annotating primes:
#16. Finding count lengths by int((length-1)/3), not by
# commifying (halves the number of commify calls) 1.68s --> 1.47s
use warnings;
use strict;
#----------------------------------------------------------------------------
# Overview: the running example in the comments is for:
# - events = A,B,C,D
# - --show=C,A,D
# - --sort=D,C
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Global variables, main data structures
#----------------------------------------------------------------------------
# CCs are arrays, the counts corresponding to @events, with 'undef'
# representing '.'. This makes things fast (faster than using hashes for CCs)
# but we have to use @sort_order and @show_order below to handle the --sort and
# --show options, which is a bit tricky.
#----------------------------------------------------------------------------
# Total counts for summary (an array reference).
my $summary_CC;
# Totals for each function, for overall summary.
# hash(filename:fn_name => CC array)
my %fn_totals;
# Individual CCs, organised by filename and line_num for easy annotation.
# hash(filename => hash(line_num => CC array))
my %allCCs;
# Files chosen for annotation on the command line.
# key = basename (trimmed of any directory), value = full filename
my %user_ann_files;
# Generic description string.
my $desc = "";
# Command line of profiled program.
my $cmd;
# Events in input file, eg. (A,B,C,D)
my @events;
# Events to show, from command line, eg. (C,A,D)
my @show_events;
# Map from @show_events indices to @events indices, eg. (2,0,3). Gives the
# order in which we must traverse @events in order to show the @show_events,
# eg. (@events[$show_order[1]], @events[$show_order[2]]...) = @show_events.
# (Might help to think of it like a hash (0 => 2, 1 => 0, 2 => 3).)
my @show_order;
# Print out the function totals sorted by these events, eg. (D,C).
my @sort_events;
# Map from @sort_events indices to @events indices, eg. (3,2). Same idea as
# for @show_order.
my @sort_order;
# Thresholds, one for each sort event (or default to 1 if no sort events
# specified). We print out functions and do auto-annotations until we've
# handled this proportion of all the events thresholded.
my @thresholds;
my $default_threshold = 0.1;
my $single_threshold = $default_threshold;
# If on, automatically annotates all files that are involved in getting over
# all the threshold counts.
my $auto_annotate = 0;
# Number of lines to show around each annotated line.
my $context = 8;
# Directories in which to look for annotation files.
my @include_dirs = ("");
# Input file name
my $input_file = undef;
# Version number
my $version = "3.11.0";
# Usage message.
my $usage = <<END
usage: cg_annotate [options] cachegrind-out-file [source-files...]
options for the user, with defaults in [ ], are:
-h --help show this message
--version show version
--show=A,B,C only show figures for events A,B,C [all]
--sort=A,B,C sort columns by events A,B,C [event column order]
--threshold=<0--20> a function is shown if it accounts for more than x% of
the counts of the primary sort event [$default_threshold]
--auto=yes|no annotate all source files containing functions
that helped reach the event count threshold [no]
--context=N print N lines of context before and after
annotated lines [8]
-I<d> --include=<d> add <d> to list of directories to search for
source files
cg_annotate is Copyright (C) 2002-2015 Nicholas Nethercote.
and licensed under the GNU General Public License, version 2.
Bug reports, feedback, admiration, abuse, etc, to: njn\@valgrind.org.
END
;
# Used in various places of output.
my $fancy = '-' x 80 . "\n";
sub safe_div($$)
{
my ($x, $y) = @_;
return ($y == 0 ? 0 : $x / $y);
}
#-----------------------------------------------------------------------------
# Argument and option handling
#-----------------------------------------------------------------------------
sub process_cmd_line()
{
for my $arg (@ARGV) {
# Option handling
if ($arg =~ /^-/) {
# --version
if ($arg =~ /^--version$/) {
die("cg_annotate-$version\n");
# --show=A,B,C
} elsif ($arg =~ /^--show=(.*)$/) {
@show_events = split(/,/, $1);
# --sort=A,B,C
# Nb: You can specify thresholds individually, eg.
# --sort=A:99,B:95,C:90. These will override any --threshold
# argument.
} elsif ($arg =~ /^--sort=(.*)$/) {
@sort_events = split(/,/, $1);
my $th_specified = 0;
foreach my $i (0 .. scalar @sort_events - 1) {
if ($sort_events[$i] =~ /.*:([\d\.]+)%?$/) {
my $th = $1;
($th >= 0 && $th <= 100) or die($usage);
$sort_events[$i] =~ s/:.*//;
$thresholds[$i] = $th;
$th_specified = 1;
} else {
$thresholds[$i] = 0;
}
}
if (not $th_specified) {
@thresholds = ();
}
# --threshold=X (tolerates a trailing '%')
} elsif ($arg =~ /^--threshold=([\d\.]+)%?$/) {
$single_threshold = $1;
($1 >= 0 && $1 <= 20) or die($usage);
# --auto=yes|no
} elsif ($arg =~ /^--auto=yes$/) {
$auto_annotate = 1;
} elsif ($arg =~ /^--auto=no$/) {
$auto_annotate = 0;
# --context=N
} elsif ($arg =~ /^--context=([\d\.]+)$/) {
$context = $1;
if ($context < 0) {
die($usage);
}
# We don't handle "-I name" -- there can be no space.
} elsif ($arg =~ /^-I$/) {
die("Sorry, no space is allowed after a -I flag\n");
# --include=A,B,C. Allow -I=name for backwards compatibility.
} elsif ($arg =~ /^(-I=|-I|--include=)(.*)$/) {
my $inc = $2;
$inc =~ s|/$||; # trim trailing '/'
push(@include_dirs, "$inc/");
} else { # -h and --help fall under this case
die($usage);
}
# Argument handling -- annotation file checking and selection.
# Stick filenames into a hash for quick 'n easy lookup throughout.
} else {
if (not defined $input_file) {
# First non-option argument is the output file.
$input_file = $arg;
} else {
# Subsequent non-option arguments are source files.
my $readable = 0;
foreach my $include_dir (@include_dirs) {
if (-r $include_dir . $arg) {
$readable = 1;
}
}
$readable or die("File $arg not found in any of: @include_dirs\n");
$user_ann_files{$arg} = 1;
}
}
}
# Must have chosen an input file
if (not defined $input_file) {
die($usage);
}
}
#-----------------------------------------------------------------------------
# Reading of input file
#-----------------------------------------------------------------------------
sub max ($$)
{
my ($x, $y) = @_;
return ($x > $y ? $x : $y);
}
# Add the two arrays; any '.' entries are ignored. Two tricky things:
# 1. If $a2->[$i] is undefined, it defaults to 0 which is what we want; we turn
# off warnings to allow this. This makes things about 10% faster than
# checking for definedness ourselves.
# 2. We don't add an undefined count or a ".", even though it's value is 0,
# because we don't want to make an $a2->[$i] that is undef become 0
# unnecessarily.
sub add_array_a_to_b ($$)
{
my ($a1, $a2) = @_;
my $n = max(scalar @$a1, scalar @$a2);
$^W = 0;
foreach my $i (0 .. $n-1) {
$a2->[$i] += $a1->[$i] if (defined $a1->[$i] && "." ne $a1->[$i]);
}
$^W = 1;
}
# Add each event count to the CC array. '.' counts become undef, as do
# missing entries (implicitly).
sub line_to_CC ($)
{
my @CC = (split /\s+/, $_[0]);
(@CC <= @events) or die("Line $.: too many event counts\n");
return \@CC;
}
sub read_input_file()
{
open(INPUTFILE, "< $input_file")
|| die "Cannot open $input_file for reading\n";
# Read "desc:" lines.
my $line;
while ($line = <INPUTFILE>) {
if ($line =~ s/desc:\s+//) {
$desc .= $line;
} else {
last;
}
}
# Read "cmd:" line (Nb: will already be in $line from "desc:" loop above).
($line =~ s/^cmd:\s+//) or die("Line $.: missing command line\n");
$cmd = $line;
chomp($cmd); # Remove newline
# Read "events:" line. We make a temporary hash in which the Nth event's
# value is N, which is useful for handling --show/--sort options below.
$line = <INPUTFILE>;
(defined $line && $line =~ s/^events:\s+//)
or die("Line $.: missing events line\n");
@events = split(/\s+/, $line);
my %events;
my $n = 0;
foreach my $event (@events) {
$events{$event} = $n;
$n++
}
# If no --show arg give, default to showing all events in the file.
# If --show option is used, check all specified events appeared in the
# "events:" line. Then initialise @show_order.
if (@show_events) {
foreach my $show_event (@show_events) {
(defined $events{$show_event}) or
die("--show event `$show_event' did not appear in input\n");
}
} else {
@show_events = @events;
}
foreach my $show_event (@show_events) {
push(@show_order, $events{$show_event});
}
# Do as for --show, but if no --sort arg given, default to sorting by
# column order (ie. first column event is primary sort key, 2nd column is
# 2ndary key, etc).
if (@sort_events) {
foreach my $sort_event (@sort_events) {
(defined $events{$sort_event}) or
die("--sort event `$sort_event' did not appear in input\n");
}
} else {
@sort_events = @events;
}
foreach my $sort_event (@sort_events) {
push(@sort_order, $events{$sort_event});
}
# If multiple threshold args weren't given via --sort, stick in the single
# threshold (either from --threshold if used, or the default otherwise) for
# the primary sort event, and 0% for the rest.
if (not @thresholds) {
foreach my $e (@sort_order) {
push(@thresholds, 100);
}
$thresholds[0] = $single_threshold;
}
my $currFileName;
my $currFileFuncName;
my $currFuncCC;
my $currFileCCs = {}; # hash(line_num => CC)
# Read body of input file.
while (<INPUTFILE>) {
s/#.*$//; # remove comments
if (s/^(-?\d+)\s+//) {
my $lineNum = $1;
my $CC = line_to_CC($_);
defined($currFuncCC) || die;
add_array_a_to_b($CC, $currFuncCC);
# If currFileName is selected, add CC to currFileName list. We look for
# full filename matches; or, if auto-annotating, we have to
# remember everything -- we won't know until the end what's needed.
defined($currFileCCs) || die;
if ($auto_annotate || defined $user_ann_files{$currFileName}) {
my $currLineCC = $currFileCCs->{$lineNum};
if (not defined $currLineCC) {
$currLineCC = [];
$currFileCCs->{$lineNum} = $currLineCC;
}
add_array_a_to_b($CC, $currLineCC);
}
} elsif (s/^fn=(.*)$//) {
$currFileFuncName = "$currFileName:$1";
$currFuncCC = $fn_totals{$currFileFuncName};
if (not defined $currFuncCC) {
$currFuncCC = [];
$fn_totals{$currFileFuncName} = $currFuncCC;
}
} elsif (s/^fl=(.*)$//) {
$currFileName = $1;
$currFileCCs = $allCCs{$currFileName};
if (not defined $currFileCCs) {
$currFileCCs = {};
$allCCs{$currFileName} = $currFileCCs;
}
# Assume that a "fn=" line is followed by a "fl=" line.
$currFileFuncName = undef;
} elsif (s/^\s*$//) {
# blank, do nothing
} elsif (s/^summary:\s+//) {
$summary_CC = line_to_CC($_);
(scalar(@$summary_CC) == @events)
or die("Line $.: summary event and total event mismatch\n");
} else {
warn("WARNING: line $. malformed, ignoring\n");
}
}
# Check if summary line was present
if (not defined $summary_CC) {
die("missing final summary line, aborting\n");
}
close(INPUTFILE);
}
#-----------------------------------------------------------------------------
# Print options used
#-----------------------------------------------------------------------------
sub print_options ()
{
print($fancy);
print($desc);
print("Command: $cmd\n");
print("Data file: $input_file\n");
print("Events recorded: @events\n");
print("Events shown: @show_events\n");
print("Event sort order: @sort_events\n");
print("Thresholds: @thresholds\n");
my @include_dirs2 = @include_dirs; # copy @include_dirs
shift(@include_dirs2); # remove "" entry, which is always the first
unshift(@include_dirs2, "") if (0 == @include_dirs2);
my $include_dir = shift(@include_dirs2);
print("Include dirs: $include_dir\n");
foreach my $include_dir (@include_dirs2) {
print(" $include_dir\n");
}
my @user_ann_files = keys %user_ann_files;
unshift(@user_ann_files, "") if (0 == @user_ann_files);
my $user_ann_file = shift(@user_ann_files);
print("User annotated: $user_ann_file\n");
foreach $user_ann_file (@user_ann_files) {
print(" $user_ann_file\n");
}
my $is_on = ($auto_annotate ? "on" : "off");
print("Auto-annotation: $is_on\n");
print("\n");
}
#-----------------------------------------------------------------------------
# Print summary and sorted function totals
#-----------------------------------------------------------------------------
sub mycmp ($$)
{
my ($c, $d) = @_;
# Iterate through sort events (eg. 3,2); return result if two are different
foreach my $i (@sort_order) {
my ($x, $y);
$x = $c->[$i];
$y = $d->[$i];
$x = -1 unless defined $x;
$y = -1 unless defined $y;
my $cmp = abs($y) <=> abs($x); # reverse sort of absolute size
if (0 != $cmp) {
return $cmp;
}
}
# Exhausted events, equal
return 0;
}
sub commify ($) {
my ($val) = @_;
1 while ($val =~ s/^(-?\d+)(\d{3})/$1,$2/);
return $val;
}
# Because the counts can get very big, and we don't want to waste screen space
# and make lines too long, we compute exactly how wide each column needs to be
# by finding the widest entry for each one.
sub compute_CC_col_widths (@)
{
my @CCs = @_;
my $CC_col_widths = [];
# Initialise with minimum widths (from event names)
foreach my $event (@events) {
push(@$CC_col_widths, length($event));
}
# Find maximum width count for each column. @CC_col_width positions
# correspond to @CC positions.
foreach my $CC (@CCs) {
foreach my $i (0 .. scalar(@$CC)-1) {
if (defined $CC->[$i]) {
# Find length, accounting for commas that will be added
my $length = length $CC->[$i];
my $clength = $length + int(($length - 1) / 3);
$CC_col_widths->[$i] = max($CC_col_widths->[$i], $clength);
}
}
}
return $CC_col_widths;
}
# Print the CC with each column's size dictated by $CC_col_widths.
sub print_CC ($$)
{
my ($CC, $CC_col_widths) = @_;
foreach my $i (@show_order) {
my $count = (defined $CC->[$i] ? commify($CC->[$i]) : ".");
my $space = ' ' x ($CC_col_widths->[$i] - length($count));
print("$space$count ");
}
}
sub print_events ($)
{
my ($CC_col_widths) = @_;
foreach my $i (@show_order) {
my $event = $events[$i];
my $event_width = length($event);
my $col_width = $CC_col_widths->[$i];
my $space = ' ' x ($col_width - $event_width);
print("$space$event ");
}
}
# Prints summary and function totals (with separate column widths, so that
# function names aren't pushed over unnecessarily by huge summary figures).
# Also returns a hash containing all the files that are involved in getting the
# events count above the thresholds (ie. all the interesting ones).
sub print_summary_and_fn_totals ()
{
my @fn_fullnames = keys %fn_totals;
# Work out the size of each column for printing (summary and functions
# separately).
my $summary_CC_col_widths = compute_CC_col_widths($summary_CC);
my $fn_CC_col_widths = compute_CC_col_widths(values %fn_totals);
# Header and counts for summary
print($fancy);
print_events($summary_CC_col_widths);
print("\n");
print($fancy);
print_CC($summary_CC, $summary_CC_col_widths);
print(" PROGRAM TOTALS\n");
print("\n");
# Header for functions
print($fancy);
print_events($fn_CC_col_widths);
print(" file:function\n");
print($fancy);
# Sort function names into order dictated by --sort option.
@fn_fullnames = sort {
mycmp($fn_totals{$a}, $fn_totals{$b})
} @fn_fullnames;
# Assertion
(scalar @sort_order == scalar @thresholds) or
die("sort_order length != thresholds length:\n",
" @sort_order\n @thresholds\n");
my $threshold_files = {};
# @curr_totals has the same shape as @sort_order and @thresholds
my @curr_totals = ();
foreach my $e (@thresholds) {
push(@curr_totals, 0);
}
# Print functions, stopping when the threshold has been reached.
foreach my $fn_name (@fn_fullnames) {
my $fn_CC = $fn_totals{$fn_name};
# Stop when we've reached all the thresholds
my $any_thresholds_exceeded = 0;
foreach my $i (0 .. scalar @thresholds - 1) {
my $prop = safe_div(abs($fn_CC->[$sort_order[$i]] * 100),
abs($summary_CC->[$sort_order[$i]]));
$any_thresholds_exceeded ||= ($prop >= $thresholds[$i]);
}
last if not $any_thresholds_exceeded;
# Print function results
print_CC($fn_CC, $fn_CC_col_widths);
print(" $fn_name\n");
# Update the threshold counts
my $filename = $fn_name;
$filename =~ s/:.+$//; # remove function name
$threshold_files->{$filename} = 1;
foreach my $i (0 .. scalar @sort_order - 1) {
$curr_totals[$i] += $fn_CC->[$sort_order[$i]]
if (defined $fn_CC->[$sort_order[$i]]);
}
}
print("\n");
return $threshold_files;
}
#-----------------------------------------------------------------------------
# Annotate selected files
#-----------------------------------------------------------------------------
# Issue a warning that the source file is more recent than the input file.
sub warning_on_src_more_recent_than_inputfile ($)
{
my $src_file = $_[0];
my $warning = <<END
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ Source file '$src_file' is more recent than input file '$input_file'.
@ Annotations may not be correct.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
END
;
print($warning);
}
# If there is information about lines not in the file, issue a warning
# explaining possible causes.
sub warning_on_nonexistent_lines ($$$)
{
my ($src_more_recent_than_inputfile, $src_file, $excess_line_nums) = @_;
my $cause_and_solution;
if ($src_more_recent_than_inputfile) {
$cause_and_solution = <<END
@@ cause: '$src_file' has changed since information was gathered.
@@ If so, a warning will have already been issued about this.
@@ solution: Recompile program and rerun under "valgrind --cachesim=yes" to
@@ gather new information.
END
# We suppress warnings about .h files
} elsif ($src_file =~ /\.h$/) {
$cause_and_solution = <<END
@@ cause: bug in the Valgrind's debug info reader that screws up with .h
@@ files sometimes
@@ solution: none, sorry
END
} else {
$cause_and_solution = <<END
@@ cause: not sure, sorry
END
}
my $warning = <<END
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@
@@ Information recorded about lines past the end of '$src_file'.
@@
@@ Probable cause and solution:
$cause_and_solution@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
END
;
print($warning);
}
sub annotate_ann_files($)
{
my ($threshold_files) = @_;
my %all_ann_files;
my @unfound_auto_annotate_files;
my $printed_totals_CC = [];
# If auto-annotating, add interesting files (but not "???")
if ($auto_annotate) {
delete $threshold_files->{"???"};
%all_ann_files = (%user_ann_files, %$threshold_files)
} else {
%all_ann_files = %user_ann_files;
}
# Track if we did any annotations.
my $did_annotations = 0;
LOOP:
foreach my $src_file (keys %all_ann_files) {
my $opened_file = "";
my $full_file_name = "";
# Nb: include_dirs already includes "", so it works in the case
# where the filename has the full path.
foreach my $include_dir (@include_dirs) {
my $try_name = $include_dir . $src_file;
if (open(INPUTFILE, "< $try_name")) {
$opened_file = $try_name;
$full_file_name = ($include_dir eq ""
? $src_file
: "$include_dir + $src_file");
last;
}
}
if (not $opened_file) {
# Failed to open the file. If chosen on the command line, die.
# If arose from auto-annotation, print a little message.
if (defined $user_ann_files{$src_file}) {
die("File $src_file not opened in any of: @include_dirs\n");
} else {
push(@unfound_auto_annotate_files, $src_file);
}
} else {
# File header (distinguish between user- and auto-selected files).
print("$fancy");
my $ann_type =
(defined $user_ann_files{$src_file} ? "User" : "Auto");
print("-- $ann_type-annotated source: $full_file_name\n");
print("$fancy");
# Get file's CCs
my $src_file_CCs = $allCCs{$src_file};
if (!defined $src_file_CCs) {
print(" No information has been collected for $src_file\n\n");
next LOOP;
}
$did_annotations = 1;
# Numeric, not lexicographic sort!
my @line_nums = sort {$a <=> $b} keys %$src_file_CCs;
# If $src_file more recent than cachegrind.out, issue warning
my $src_more_recent_than_inputfile = 0;
if ((stat $opened_file)[9] > (stat $input_file)[9]) {
$src_more_recent_than_inputfile = 1;
warning_on_src_more_recent_than_inputfile($src_file);
}
# Work out the size of each column for printing
my $CC_col_widths = compute_CC_col_widths(values %$src_file_CCs);
# Events header
print_events($CC_col_widths);
print("\n\n");
# Shift out 0 if it's in the line numbers (from unknown entries,
# likely due to bugs in Valgrind's stabs debug info reader)
shift(@line_nums) if (0 == $line_nums[0]);
# Finds interesting line ranges -- all lines with a CC, and all
# lines within $context lines of a line with a CC.
my $n = @line_nums;
my @pairs;
for (my $i = 0; $i < $n; $i++) {
push(@pairs, $line_nums[$i] - $context); # lower marker
while ($i < $n-1 &&
$line_nums[$i] + 2*$context >= $line_nums[$i+1]) {
$i++;
}
push(@pairs, $line_nums[$i] + $context); # upper marker
}
# Annotate chosen lines, tracking total counts of lines printed
$pairs[0] = 1 if ($pairs[0] < 1);
while (@pairs) {
my $low = shift @pairs;
my $high = shift @pairs;
while ($. < $low-1) {
my $tmp = <INPUTFILE>;
last unless (defined $tmp); # hack to detect EOF
}
my $src_line;
# Print line number, unless start of file
print("-- line $low " . '-' x 40 . "\n") if ($low != 1);
while (($. < $high) && ($src_line = <INPUTFILE>)) {
if (defined $line_nums[0] && $. == $line_nums[0]) {
print_CC($src_file_CCs->{$.}, $CC_col_widths);
add_array_a_to_b($src_file_CCs->{$.},
$printed_totals_CC);
shift(@line_nums);
} else {
print_CC( [], $CC_col_widths);
}
print(" $src_line");
}
# Print line number, unless EOF
if ($src_line) {
print("-- line $high " . '-' x 40 . "\n");
} else {
last;
}
}
# If there was info on lines past the end of the file...
if (@line_nums) {
foreach my $line_num (@line_nums) {
print_CC($src_file_CCs->{$line_num}, $CC_col_widths);
print(" <bogus line $line_num>\n");
}
print("\n");
warning_on_nonexistent_lines($src_more_recent_than_inputfile,
$src_file, \@line_nums);
}
print("\n");
# Print summary of counts attributed to file but not to any
# particular line (due to incomplete debug info).
if ($src_file_CCs->{0}) {
print_CC($src_file_CCs->{0}, $CC_col_widths);
print(" <counts for unidentified lines in $src_file>\n\n");
}
close(INPUTFILE);
}
}
# Print list of unfound auto-annotate selected files.
if (@unfound_auto_annotate_files) {
print("$fancy");
print("The following files chosen for auto-annotation could not be found:\n");
print($fancy);
foreach my $f (@unfound_auto_annotate_files) {
print(" $f\n");
}
print("\n");
}
# If we did any annotating, print what proportion of events were covered by
# annotated lines above.
if ($did_annotations) {
my $percent_printed_CC;
foreach (my $i = 0; $i < @$summary_CC; $i++) {
$percent_printed_CC->[$i] =
sprintf("%.0f",
100 * safe_div(abs($printed_totals_CC->[$i]),
abs($summary_CC->[$i])));
}
my $pp_CC_col_widths = compute_CC_col_widths($percent_printed_CC);
print($fancy);
print_events($pp_CC_col_widths);
print("\n");
print($fancy);
print_CC($percent_printed_CC, $pp_CC_col_widths);
print(" percentage of events annotated\n\n");
}
}
#----------------------------------------------------------------------------
# "main()"
#----------------------------------------------------------------------------
process_cmd_line();
read_input_file();
print_options();
my $threshold_files = print_summary_and_fn_totals();
annotate_ann_files($threshold_files);
##--------------------------------------------------------------------##
##--- end cg_annotate.in ---##
##--------------------------------------------------------------------##
@@ -0,0 +1,911 @@
#! @PERL@
##--------------------------------------------------------------------##
##--- Cachegrind's annotator. cg_annotate.in ---##
##--------------------------------------------------------------------##
# This file is part of Cachegrind, a Valgrind tool for cache
# profiling programs.
#
# Copyright (C) 2002-2015 Nicholas Nethercote
# njn@valgrind.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307, USA.
#
# The GNU General Public License is contained in the file COPYING.
#----------------------------------------------------------------------------
# The file format is simple, basically printing the cost centre for every
# source line, grouped by files and functions. The details are in
# Cachegrind's manual.
#----------------------------------------------------------------------------
# Performance improvements record, using cachegrind.out for cacheprof, doing no
# source annotation (irrelevant ones removed):
# user time
# 1. turned off warnings in add_hash_a_to_b() 3.81 --> 3.48s
# [now add_array_a_to_b()]
# 6. make line_to_CC() return a ref instead of a hash 3.01 --> 2.77s
#
#10. changed file format to avoid file/fn name repetition 2.40s
# (not sure why higher; maybe due to new '.' entries?)
#11. changed file format to drop unnecessary end-line "."s 2.36s
# (shrunk file by about 37%)
#12. switched from hash CCs to array CCs 1.61s
#13. only adding b[i] to a[i] if b[i] defined (was doing it if
# either a[i] or b[i] was defined, but if b[i] was undefined
# it just added 0) 1.48s
#14. Stopped converting "." entries to undef and then back 1.16s
#15. Using foreach $i (x..y) instead of for ($i = 0...) in
# add_array_a_to_b() 1.11s
#
# Auto-annotating primes:
#16. Finding count lengths by int((length-1)/3), not by
# commifying (halves the number of commify calls) 1.68s --> 1.47s
use warnings;
use strict;
#----------------------------------------------------------------------------
# Overview: the running example in the comments is for:
# - events = A,B,C,D
# - --show=C,A,D
# - --sort=D,C
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Global variables, main data structures
#----------------------------------------------------------------------------
# CCs are arrays, the counts corresponding to @events, with 'undef'
# representing '.'. This makes things fast (faster than using hashes for CCs)
# but we have to use @sort_order and @show_order below to handle the --sort and
# --show options, which is a bit tricky.
#----------------------------------------------------------------------------
# Total counts for summary (an array reference).
my $summary_CC;
# Totals for each function, for overall summary.
# hash(filename:fn_name => CC array)
my %fn_totals;
# Individual CCs, organised by filename and line_num for easy annotation.
# hash(filename => hash(line_num => CC array))
my %allCCs;
# Files chosen for annotation on the command line.
# key = basename (trimmed of any directory), value = full filename
my %user_ann_files;
# Generic description string.
my $desc = "";
# Command line of profiled program.
my $cmd;
# Events in input file, eg. (A,B,C,D)
my @events;
# Events to show, from command line, eg. (C,A,D)
my @show_events;
# Map from @show_events indices to @events indices, eg. (2,0,3). Gives the
# order in which we must traverse @events in order to show the @show_events,
# eg. (@events[$show_order[1]], @events[$show_order[2]]...) = @show_events.
# (Might help to think of it like a hash (0 => 2, 1 => 0, 2 => 3).)
my @show_order;
# Print out the function totals sorted by these events, eg. (D,C).
my @sort_events;
# Map from @sort_events indices to @events indices, eg. (3,2). Same idea as
# for @show_order.
my @sort_order;
# Thresholds, one for each sort event (or default to 1 if no sort events
# specified). We print out functions and do auto-annotations until we've
# handled this proportion of all the events thresholded.
my @thresholds;
my $default_threshold = 0.1;
my $single_threshold = $default_threshold;
# If on, automatically annotates all files that are involved in getting over
# all the threshold counts.
my $auto_annotate = 0;
# Number of lines to show around each annotated line.
my $context = 8;
# Directories in which to look for annotation files.
my @include_dirs = ("");
# Input file name
my $input_file = undef;
# Version number
my $version = "@VERSION@";
# Usage message.
my $usage = <<END
usage: cg_annotate [options] cachegrind-out-file [source-files...]
options for the user, with defaults in [ ], are:
-h --help show this message
--version show version
--show=A,B,C only show figures for events A,B,C [all]
--sort=A,B,C sort columns by events A,B,C [event column order]
--threshold=<0--20> a function is shown if it accounts for more than x% of
the counts of the primary sort event [$default_threshold]
--auto=yes|no annotate all source files containing functions
that helped reach the event count threshold [no]
--context=N print N lines of context before and after
annotated lines [8]
-I<d> --include=<d> add <d> to list of directories to search for
source files
cg_annotate is Copyright (C) 2002-2015 Nicholas Nethercote.
and licensed under the GNU General Public License, version 2.
Bug reports, feedback, admiration, abuse, etc, to: njn\@valgrind.org.
END
;
# Used in various places of output.
my $fancy = '-' x 80 . "\n";
sub safe_div($$)
{
my ($x, $y) = @_;
return ($y == 0 ? 0 : $x / $y);
}
#-----------------------------------------------------------------------------
# Argument and option handling
#-----------------------------------------------------------------------------
sub process_cmd_line()
{
for my $arg (@ARGV) {
# Option handling
if ($arg =~ /^-/) {
# --version
if ($arg =~ /^--version$/) {
die("cg_annotate-$version\n");
# --show=A,B,C
} elsif ($arg =~ /^--show=(.*)$/) {
@show_events = split(/,/, $1);
# --sort=A,B,C
# Nb: You can specify thresholds individually, eg.
# --sort=A:99,B:95,C:90. These will override any --threshold
# argument.
} elsif ($arg =~ /^--sort=(.*)$/) {
@sort_events = split(/,/, $1);
my $th_specified = 0;
foreach my $i (0 .. scalar @sort_events - 1) {
if ($sort_events[$i] =~ /.*:([\d\.]+)%?$/) {
my $th = $1;
($th >= 0 && $th <= 100) or die($usage);
$sort_events[$i] =~ s/:.*//;
$thresholds[$i] = $th;
$th_specified = 1;
} else {
$thresholds[$i] = 0;
}
}
if (not $th_specified) {
@thresholds = ();
}
# --threshold=X (tolerates a trailing '%')
} elsif ($arg =~ /^--threshold=([\d\.]+)%?$/) {
$single_threshold = $1;
($1 >= 0 && $1 <= 20) or die($usage);
# --auto=yes|no
} elsif ($arg =~ /^--auto=yes$/) {
$auto_annotate = 1;
} elsif ($arg =~ /^--auto=no$/) {
$auto_annotate = 0;
# --context=N
} elsif ($arg =~ /^--context=([\d\.]+)$/) {
$context = $1;
if ($context < 0) {
die($usage);
}
# We don't handle "-I name" -- there can be no space.
} elsif ($arg =~ /^-I$/) {
die("Sorry, no space is allowed after a -I flag\n");
# --include=A,B,C. Allow -I=name for backwards compatibility.
} elsif ($arg =~ /^(-I=|-I|--include=)(.*)$/) {
my $inc = $2;
$inc =~ s|/$||; # trim trailing '/'
push(@include_dirs, "$inc/");
} else { # -h and --help fall under this case
die($usage);
}
# Argument handling -- annotation file checking and selection.
# Stick filenames into a hash for quick 'n easy lookup throughout.
} else {
if (not defined $input_file) {
# First non-option argument is the output file.
$input_file = $arg;
} else {
# Subsequent non-option arguments are source files.
my $readable = 0;
foreach my $include_dir (@include_dirs) {
if (-r $include_dir . $arg) {
$readable = 1;
}
}
$readable or die("File $arg not found in any of: @include_dirs\n");
$user_ann_files{$arg} = 1;
}
}
}
# Must have chosen an input file
if (not defined $input_file) {
die($usage);
}
}
#-----------------------------------------------------------------------------
# Reading of input file
#-----------------------------------------------------------------------------
sub max ($$)
{
my ($x, $y) = @_;
return ($x > $y ? $x : $y);
}
# Add the two arrays; any '.' entries are ignored. Two tricky things:
# 1. If $a2->[$i] is undefined, it defaults to 0 which is what we want; we turn
# off warnings to allow this. This makes things about 10% faster than
# checking for definedness ourselves.
# 2. We don't add an undefined count or a ".", even though it's value is 0,
# because we don't want to make an $a2->[$i] that is undef become 0
# unnecessarily.
sub add_array_a_to_b ($$)
{
my ($a1, $a2) = @_;
my $n = max(scalar @$a1, scalar @$a2);
$^W = 0;
foreach my $i (0 .. $n-1) {
$a2->[$i] += $a1->[$i] if (defined $a1->[$i] && "." ne $a1->[$i]);
}
$^W = 1;
}
# Add each event count to the CC array. '.' counts become undef, as do
# missing entries (implicitly).
sub line_to_CC ($)
{
my @CC = (split /\s+/, $_[0]);
(@CC <= @events) or die("Line $.: too many event counts\n");
return \@CC;
}
sub read_input_file()
{
open(INPUTFILE, "< $input_file")
|| die "Cannot open $input_file for reading\n";
# Read "desc:" lines.
my $line;
while ($line = <INPUTFILE>) {
if ($line =~ s/desc:\s+//) {
$desc .= $line;
} else {
last;
}
}
# Read "cmd:" line (Nb: will already be in $line from "desc:" loop above).
($line =~ s/^cmd:\s+//) or die("Line $.: missing command line\n");
$cmd = $line;
chomp($cmd); # Remove newline
# Read "events:" line. We make a temporary hash in which the Nth event's
# value is N, which is useful for handling --show/--sort options below.
$line = <INPUTFILE>;
(defined $line && $line =~ s/^events:\s+//)
or die("Line $.: missing events line\n");
@events = split(/\s+/, $line);
my %events;
my $n = 0;
foreach my $event (@events) {
$events{$event} = $n;
$n++
}
# If no --show arg give, default to showing all events in the file.
# If --show option is used, check all specified events appeared in the
# "events:" line. Then initialise @show_order.
if (@show_events) {
foreach my $show_event (@show_events) {
(defined $events{$show_event}) or
die("--show event `$show_event' did not appear in input\n");
}
} else {
@show_events = @events;
}
foreach my $show_event (@show_events) {
push(@show_order, $events{$show_event});
}
# Do as for --show, but if no --sort arg given, default to sorting by
# column order (ie. first column event is primary sort key, 2nd column is
# 2ndary key, etc).
if (@sort_events) {
foreach my $sort_event (@sort_events) {
(defined $events{$sort_event}) or
die("--sort event `$sort_event' did not appear in input\n");
}
} else {
@sort_events = @events;
}
foreach my $sort_event (@sort_events) {
push(@sort_order, $events{$sort_event});
}
# If multiple threshold args weren't given via --sort, stick in the single
# threshold (either from --threshold if used, or the default otherwise) for
# the primary sort event, and 0% for the rest.
if (not @thresholds) {
foreach my $e (@sort_order) {
push(@thresholds, 100);
}
$thresholds[0] = $single_threshold;
}
my $currFileName;
my $currFileFuncName;
my $currFuncCC;
my $currFileCCs = {}; # hash(line_num => CC)
# Read body of input file.
while (<INPUTFILE>) {
s/#.*$//; # remove comments
if (s/^(-?\d+)\s+//) {
my $lineNum = $1;
my $CC = line_to_CC($_);
defined($currFuncCC) || die;
add_array_a_to_b($CC, $currFuncCC);
# If currFileName is selected, add CC to currFileName list. We look for
# full filename matches; or, if auto-annotating, we have to
# remember everything -- we won't know until the end what's needed.
defined($currFileCCs) || die;
if ($auto_annotate || defined $user_ann_files{$currFileName}) {
my $currLineCC = $currFileCCs->{$lineNum};
if (not defined $currLineCC) {
$currLineCC = [];
$currFileCCs->{$lineNum} = $currLineCC;
}
add_array_a_to_b($CC, $currLineCC);
}
} elsif (s/^fn=(.*)$//) {
$currFileFuncName = "$currFileName:$1";
$currFuncCC = $fn_totals{$currFileFuncName};
if (not defined $currFuncCC) {
$currFuncCC = [];
$fn_totals{$currFileFuncName} = $currFuncCC;
}
} elsif (s/^fl=(.*)$//) {
$currFileName = $1;
$currFileCCs = $allCCs{$currFileName};
if (not defined $currFileCCs) {
$currFileCCs = {};
$allCCs{$currFileName} = $currFileCCs;
}
# Assume that a "fn=" line is followed by a "fl=" line.
$currFileFuncName = undef;
} elsif (s/^\s*$//) {
# blank, do nothing
} elsif (s/^summary:\s+//) {
$summary_CC = line_to_CC($_);
(scalar(@$summary_CC) == @events)
or die("Line $.: summary event and total event mismatch\n");
} else {
warn("WARNING: line $. malformed, ignoring\n");
}
}
# Check if summary line was present
if (not defined $summary_CC) {
die("missing final summary line, aborting\n");
}
close(INPUTFILE);
}
#-----------------------------------------------------------------------------
# Print options used
#-----------------------------------------------------------------------------
sub print_options ()
{
print($fancy);
print($desc);
print("Command: $cmd\n");
print("Data file: $input_file\n");
print("Events recorded: @events\n");
print("Events shown: @show_events\n");
print("Event sort order: @sort_events\n");
print("Thresholds: @thresholds\n");
my @include_dirs2 = @include_dirs; # copy @include_dirs
shift(@include_dirs2); # remove "" entry, which is always the first
unshift(@include_dirs2, "") if (0 == @include_dirs2);
my $include_dir = shift(@include_dirs2);
print("Include dirs: $include_dir\n");
foreach my $include_dir (@include_dirs2) {
print(" $include_dir\n");
}
my @user_ann_files = keys %user_ann_files;
unshift(@user_ann_files, "") if (0 == @user_ann_files);
my $user_ann_file = shift(@user_ann_files);
print("User annotated: $user_ann_file\n");
foreach $user_ann_file (@user_ann_files) {
print(" $user_ann_file\n");
}
my $is_on = ($auto_annotate ? "on" : "off");
print("Auto-annotation: $is_on\n");
print("\n");
}
#-----------------------------------------------------------------------------
# Print summary and sorted function totals
#-----------------------------------------------------------------------------
sub mycmp ($$)
{
my ($c, $d) = @_;
# Iterate through sort events (eg. 3,2); return result if two are different
foreach my $i (@sort_order) {
my ($x, $y);
$x = $c->[$i];
$y = $d->[$i];
$x = -1 unless defined $x;
$y = -1 unless defined $y;
my $cmp = abs($y) <=> abs($x); # reverse sort of absolute size
if (0 != $cmp) {
return $cmp;
}
}
# Exhausted events, equal
return 0;
}
sub commify ($) {
my ($val) = @_;
1 while ($val =~ s/^(-?\d+)(\d{3})/$1,$2/);
return $val;
}
# Because the counts can get very big, and we don't want to waste screen space
# and make lines too long, we compute exactly how wide each column needs to be
# by finding the widest entry for each one.
sub compute_CC_col_widths (@)
{
my @CCs = @_;
my $CC_col_widths = [];
# Initialise with minimum widths (from event names)
foreach my $event (@events) {
push(@$CC_col_widths, length($event));
}
# Find maximum width count for each column. @CC_col_width positions
# correspond to @CC positions.
foreach my $CC (@CCs) {
foreach my $i (0 .. scalar(@$CC)-1) {
if (defined $CC->[$i]) {
# Find length, accounting for commas that will be added
my $length = length $CC->[$i];
my $clength = $length + int(($length - 1) / 3);
$CC_col_widths->[$i] = max($CC_col_widths->[$i], $clength);
}
}
}
return $CC_col_widths;
}
# Print the CC with each column's size dictated by $CC_col_widths.
sub print_CC ($$)
{
my ($CC, $CC_col_widths) = @_;
foreach my $i (@show_order) {
my $count = (defined $CC->[$i] ? commify($CC->[$i]) : ".");
my $space = ' ' x ($CC_col_widths->[$i] - length($count));
print("$space$count ");
}
}
sub print_events ($)
{
my ($CC_col_widths) = @_;
foreach my $i (@show_order) {
my $event = $events[$i];
my $event_width = length($event);
my $col_width = $CC_col_widths->[$i];
my $space = ' ' x ($col_width - $event_width);
print("$space$event ");
}
}
# Prints summary and function totals (with separate column widths, so that
# function names aren't pushed over unnecessarily by huge summary figures).
# Also returns a hash containing all the files that are involved in getting the
# events count above the thresholds (ie. all the interesting ones).
sub print_summary_and_fn_totals ()
{
my @fn_fullnames = keys %fn_totals;
# Work out the size of each column for printing (summary and functions
# separately).
my $summary_CC_col_widths = compute_CC_col_widths($summary_CC);
my $fn_CC_col_widths = compute_CC_col_widths(values %fn_totals);
# Header and counts for summary
print($fancy);
print_events($summary_CC_col_widths);
print("\n");
print($fancy);
print_CC($summary_CC, $summary_CC_col_widths);
print(" PROGRAM TOTALS\n");
print("\n");
# Header for functions
print($fancy);
print_events($fn_CC_col_widths);
print(" file:function\n");
print($fancy);
# Sort function names into order dictated by --sort option.
@fn_fullnames = sort {
mycmp($fn_totals{$a}, $fn_totals{$b})
} @fn_fullnames;
# Assertion
(scalar @sort_order == scalar @thresholds) or
die("sort_order length != thresholds length:\n",
" @sort_order\n @thresholds\n");
my $threshold_files = {};
# @curr_totals has the same shape as @sort_order and @thresholds
my @curr_totals = ();
foreach my $e (@thresholds) {
push(@curr_totals, 0);
}
# Print functions, stopping when the threshold has been reached.
foreach my $fn_name (@fn_fullnames) {
my $fn_CC = $fn_totals{$fn_name};
# Stop when we've reached all the thresholds
my $any_thresholds_exceeded = 0;
foreach my $i (0 .. scalar @thresholds - 1) {
my $prop = safe_div(abs($fn_CC->[$sort_order[$i]] * 100),
abs($summary_CC->[$sort_order[$i]]));
$any_thresholds_exceeded ||= ($prop >= $thresholds[$i]);
}
last if not $any_thresholds_exceeded;
# Print function results
print_CC($fn_CC, $fn_CC_col_widths);
print(" $fn_name\n");
# Update the threshold counts
my $filename = $fn_name;
$filename =~ s/:.+$//; # remove function name
$threshold_files->{$filename} = 1;
foreach my $i (0 .. scalar @sort_order - 1) {
$curr_totals[$i] += $fn_CC->[$sort_order[$i]]
if (defined $fn_CC->[$sort_order[$i]]);
}
}
print("\n");
return $threshold_files;
}
#-----------------------------------------------------------------------------
# Annotate selected files
#-----------------------------------------------------------------------------
# Issue a warning that the source file is more recent than the input file.
sub warning_on_src_more_recent_than_inputfile ($)
{
my $src_file = $_[0];
my $warning = <<END
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ Source file '$src_file' is more recent than input file '$input_file'.
@ Annotations may not be correct.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
END
;
print($warning);
}
# If there is information about lines not in the file, issue a warning
# explaining possible causes.
sub warning_on_nonexistent_lines ($$$)
{
my ($src_more_recent_than_inputfile, $src_file, $excess_line_nums) = @_;
my $cause_and_solution;
if ($src_more_recent_than_inputfile) {
$cause_and_solution = <<END
@@ cause: '$src_file' has changed since information was gathered.
@@ If so, a warning will have already been issued about this.
@@ solution: Recompile program and rerun under "valgrind --cachesim=yes" to
@@ gather new information.
END
# We suppress warnings about .h files
} elsif ($src_file =~ /\.h$/) {
$cause_and_solution = <<END
@@ cause: bug in the Valgrind's debug info reader that screws up with .h
@@ files sometimes
@@ solution: none, sorry
END
} else {
$cause_and_solution = <<END
@@ cause: not sure, sorry
END
}
my $warning = <<END
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@
@@ Information recorded about lines past the end of '$src_file'.
@@
@@ Probable cause and solution:
$cause_and_solution@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
END
;
print($warning);
}
sub annotate_ann_files($)
{
my ($threshold_files) = @_;
my %all_ann_files;
my @unfound_auto_annotate_files;
my $printed_totals_CC = [];
# If auto-annotating, add interesting files (but not "???")
if ($auto_annotate) {
delete $threshold_files->{"???"};
%all_ann_files = (%user_ann_files, %$threshold_files)
} else {
%all_ann_files = %user_ann_files;
}
# Track if we did any annotations.
my $did_annotations = 0;
LOOP:
foreach my $src_file (keys %all_ann_files) {
my $opened_file = "";
my $full_file_name = "";
# Nb: include_dirs already includes "", so it works in the case
# where the filename has the full path.
foreach my $include_dir (@include_dirs) {
my $try_name = $include_dir . $src_file;
if (open(INPUTFILE, "< $try_name")) {
$opened_file = $try_name;
$full_file_name = ($include_dir eq ""
? $src_file
: "$include_dir + $src_file");
last;
}
}
if (not $opened_file) {
# Failed to open the file. If chosen on the command line, die.
# If arose from auto-annotation, print a little message.
if (defined $user_ann_files{$src_file}) {
die("File $src_file not opened in any of: @include_dirs\n");
} else {
push(@unfound_auto_annotate_files, $src_file);
}
} else {
# File header (distinguish between user- and auto-selected files).
print("$fancy");
my $ann_type =
(defined $user_ann_files{$src_file} ? "User" : "Auto");
print("-- $ann_type-annotated source: $full_file_name\n");
print("$fancy");
# Get file's CCs
my $src_file_CCs = $allCCs{$src_file};
if (!defined $src_file_CCs) {
print(" No information has been collected for $src_file\n\n");
next LOOP;
}
$did_annotations = 1;
# Numeric, not lexicographic sort!
my @line_nums = sort {$a <=> $b} keys %$src_file_CCs;
# If $src_file more recent than cachegrind.out, issue warning
my $src_more_recent_than_inputfile = 0;
if ((stat $opened_file)[9] > (stat $input_file)[9]) {
$src_more_recent_than_inputfile = 1;
warning_on_src_more_recent_than_inputfile($src_file);
}
# Work out the size of each column for printing
my $CC_col_widths = compute_CC_col_widths(values %$src_file_CCs);
# Events header
print_events($CC_col_widths);
print("\n\n");
# Shift out 0 if it's in the line numbers (from unknown entries,
# likely due to bugs in Valgrind's stabs debug info reader)
shift(@line_nums) if (0 == $line_nums[0]);
# Finds interesting line ranges -- all lines with a CC, and all
# lines within $context lines of a line with a CC.
my $n = @line_nums;
my @pairs;
for (my $i = 0; $i < $n; $i++) {
push(@pairs, $line_nums[$i] - $context); # lower marker
while ($i < $n-1 &&
$line_nums[$i] + 2*$context >= $line_nums[$i+1]) {
$i++;
}
push(@pairs, $line_nums[$i] + $context); # upper marker
}
# Annotate chosen lines, tracking total counts of lines printed
$pairs[0] = 1 if ($pairs[0] < 1);
while (@pairs) {
my $low = shift @pairs;
my $high = shift @pairs;
while ($. < $low-1) {
my $tmp = <INPUTFILE>;
last unless (defined $tmp); # hack to detect EOF
}
my $src_line;
# Print line number, unless start of file
print("-- line $low " . '-' x 40 . "\n") if ($low != 1);
while (($. < $high) && ($src_line = <INPUTFILE>)) {
if (defined $line_nums[0] && $. == $line_nums[0]) {
print_CC($src_file_CCs->{$.}, $CC_col_widths);
add_array_a_to_b($src_file_CCs->{$.},
$printed_totals_CC);
shift(@line_nums);
} else {
print_CC( [], $CC_col_widths);
}
print(" $src_line");
}
# Print line number, unless EOF
if ($src_line) {
print("-- line $high " . '-' x 40 . "\n");
} else {
last;
}
}
# If there was info on lines past the end of the file...
if (@line_nums) {
foreach my $line_num (@line_nums) {
print_CC($src_file_CCs->{$line_num}, $CC_col_widths);
print(" <bogus line $line_num>\n");
}
print("\n");
warning_on_nonexistent_lines($src_more_recent_than_inputfile,
$src_file, \@line_nums);
}
print("\n");
# Print summary of counts attributed to file but not to any
# particular line (due to incomplete debug info).
if ($src_file_CCs->{0}) {
print_CC($src_file_CCs->{0}, $CC_col_widths);
print(" <counts for unidentified lines in $src_file>\n\n");
}
close(INPUTFILE);
}
}
# Print list of unfound auto-annotate selected files.
if (@unfound_auto_annotate_files) {
print("$fancy");
print("The following files chosen for auto-annotation could not be found:\n");
print($fancy);
foreach my $f (@unfound_auto_annotate_files) {
print(" $f\n");
}
print("\n");
}
# If we did any annotating, print what proportion of events were covered by
# annotated lines above.
if ($did_annotations) {
my $percent_printed_CC;
foreach (my $i = 0; $i < @$summary_CC; $i++) {
$percent_printed_CC->[$i] =
sprintf("%.0f",
100 * safe_div(abs($printed_totals_CC->[$i]),
abs($summary_CC->[$i])));
}
my $pp_CC_col_widths = compute_CC_col_widths($percent_printed_CC);
print($fancy);
print_events($pp_CC_col_widths);
print("\n");
print($fancy);
print_CC($percent_printed_CC, $pp_CC_col_widths);
print(" percentage of events annotated\n\n");
}
}
#----------------------------------------------------------------------------
# "main()"
#----------------------------------------------------------------------------
process_cmd_line();
read_input_file();
print_options();
my $threshold_files = print_summary_and_fn_totals();
annotate_ann_files($threshold_files);
##--------------------------------------------------------------------##
##--- end cg_annotate.in ---##
##--------------------------------------------------------------------##
@@ -0,0 +1,503 @@
/*--------------------------------------------------------------------*/
/*--- Cachegrind: cache configuration. cg-arch.c ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Cachegrind, a Valgrind tool for cache
profiling programs.
Copyright (C) 2011-2015 Nicholas Nethercote
njn@valgrind.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
#include "pub_tool_basics.h"
#include "pub_tool_libcassert.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_options.h"
#include "pub_tool_machine.h"
#include "cg_arch.h"
static void configure_caches(cache_t* I1c, cache_t* D1c, cache_t* LLc,
Bool all_caches_clo_defined);
// Checks cache config is ok. Returns NULL if ok, or a pointer to an error
// string otherwise.
static const HChar* check_cache(cache_t* cache)
{
// Simulator requires set count to be a power of two.
if ((cache->size % (cache->line_size * cache->assoc) != 0) ||
(-1 == VG_(log2)(cache->size/cache->line_size/cache->assoc)))
{
return "Cache set count is not a power of two.\n";
}
// Simulator requires line size to be a power of two.
if (-1 == VG_(log2)(cache->line_size)) {
return "Cache line size is not a power of two.\n";
}
// Then check line size >= 16 -- any smaller and a single instruction could
// straddle three cache lines, which breaks a simulation assertion and is
// stupid anyway.
if (cache->line_size < MIN_LINE_SIZE) {
return "Cache line size is too small.\n";
}
/* Then check cache size > line size (causes seg faults if not). */
if (cache->size <= cache->line_size) {
return "Cache size <= line size.\n";
}
/* Then check assoc <= (size / line size) (seg faults otherwise). */
if (cache->assoc > (cache->size / cache->line_size)) {
return "Cache associativity > (size / line size).\n";
}
return NULL;
}
static void parse_cache_opt ( cache_t* cache, const HChar* opt,
const HChar* optval )
{
Long i1, i2, i3;
HChar* endptr;
const HChar* checkRes;
// Option argument looks like "65536,2,64". Extract them.
i1 = VG_(strtoll10)(optval, &endptr); if (*endptr != ',') goto bad;
i2 = VG_(strtoll10)(endptr+1, &endptr); if (*endptr != ',') goto bad;
i3 = VG_(strtoll10)(endptr+1, &endptr); if (*endptr != '\0') goto bad;
// Check for overflow.
cache->size = (Int)i1;
cache->assoc = (Int)i2;
cache->line_size = (Int)i3;
if (cache->size != i1) goto overflow;
if (cache->assoc != i2) goto overflow;
if (cache->line_size != i3) goto overflow;
checkRes = check_cache(cache);
if (checkRes) {
VG_(fmsg)("%s", checkRes);
goto bad;
}
return;
bad:
VG_(fmsg_bad_option)(opt, "Bad argument '%s'\n", optval);
overflow:
VG_(fmsg_bad_option)(opt,
"One of the cache parameters was too large and overflowed.\n");
}
Bool VG_(str_clo_cache_opt)(const HChar *arg,
cache_t* clo_I1c,
cache_t* clo_D1c,
cache_t* clo_LLc)
{
const HChar* tmp_str;
if VG_STR_CLO(arg, "--I1", tmp_str) {
parse_cache_opt(clo_I1c, arg, tmp_str);
return True;
} else if VG_STR_CLO(arg, "--D1", tmp_str) {
parse_cache_opt(clo_D1c, arg, tmp_str);
return True;
} else if (VG_STR_CLO(arg, "--L2", tmp_str) || // for backwards compatibility
VG_STR_CLO(arg, "--LL", tmp_str)) {
parse_cache_opt(clo_LLc, arg, tmp_str);
return True;
} else
return False;
}
static void umsg_cache_img(const HChar* desc, cache_t* c)
{
VG_(umsg)(" %s: %'d B, %d-way, %d B lines\n", desc,
c->size, c->assoc, c->line_size);
}
// Verifies if c is a valid cache.
// An invalid value causes an assert, unless clo_redefined is True.
static void check_cache_or_override(const HChar* desc, cache_t* c, Bool clo_redefined)
{
const HChar* checkRes;
checkRes = check_cache(c);
if (checkRes) {
VG_(umsg)("Auto-detected %s cache configuration not supported: %s",
desc, checkRes);
umsg_cache_img(desc, c);
if (!clo_redefined) {
VG_(umsg)("As it probably should be supported, please report a bug!\n");
VG_(umsg)("Bypass this message by using option --%s=...\n", desc);
tl_assert(0);
}
}
}
/* If the LL cache config isn't something the simulation functions
can handle, try to adjust it so it is. Caches are characterised
by (total size T, line size L, associativity A), and then we
have
number of sets S = T / (L * A)
The required constraints are:
* L must be a power of 2, but it always is in practice, so
no problem there
* A can be any value >= 1
* T can be any value, but ..
* S must be a power of 2.
That sometimes gives a problem. For example, some Core iX based
Intel CPUs have T = 12MB, A = 16, L = 64, which gives 12288
sets. Some AMD cpus have T = 5MB, A = 48, L = 64, which gives
1706.667 sets (!).
The "fix" is to force S down to the nearest power of two below its
original value, and increase A proportionately, so as to keep the
total cache size the same. In fact to be safe we recalculate the
cache size afterwards anyway, to guarantee that it divides exactly
between the new number of sets.
The "fix" is "justified" (cough, cough) by alleging that
increases of associativity above about 4 have very little effect
on the actual miss rate. It would be far more inaccurate to
fudge this by changing the size of the simulated cache --
changing the associativity is a much better option.
*/
/* (Helper function) Returns the largest power of 2 that is <= |x|.
Even works when |x| == 0. */
static UInt floor_power_of_2 ( UInt x )
{
x = x | (x >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >> 16);
return x - (x >> 1);
}
static void
maybe_tweak_LLc(cache_t *LLc)
{
if (LLc->size == 0 || LLc->assoc == 0 || LLc->line_size == 0)
return;
tl_assert(LLc->size > 0 && LLc->assoc > 0 && LLc->line_size > 0);
UInt old_size = (UInt)LLc->size;
UInt old_assoc = (UInt)LLc->assoc;
UInt old_line_size = (UInt)LLc->line_size;
UInt new_size = old_size;
UInt new_assoc = old_assoc;
UInt new_line_size = old_line_size;
UInt old_nSets = old_size / (old_assoc * old_line_size);
if (old_nSets == 0) {
/* This surely can't happen; but would cause chaos with the maths
* below if it did. Just give up if it does. */
return;
}
if (-1 != VG_(log2_64)(old_nSets)) {
/* The number of sets is already a power of 2. Make sure that
the size divides exactly between the sets. Almost all of the
time this will have no effect. */
new_size = old_line_size * old_assoc * old_nSets;
} else {
/* The number of sets isn't a power of two. Calculate some
scale-down factor which causes the number of sets to become a
power of two. Then, increase the associativity by that
factor. Finally, re-calculate the total size so as to make
sure it divides exactly between the sets. */
tl_assert(old_nSets >= 0);
UInt new_nSets = floor_power_of_2 ( old_nSets );
tl_assert(new_nSets > 0 && new_nSets < old_nSets);
Double factor = (Double)old_nSets / (Double)new_nSets;
tl_assert(factor >= 1.0);
new_assoc = (UInt)(0.5 + factor * (Double)old_assoc);
tl_assert(new_assoc >= old_assoc);
new_size = old_line_size * new_assoc * new_nSets;
}
tl_assert(new_line_size == old_line_size); /* we never change this */
if (new_size == old_size && new_assoc == old_assoc)
return;
VG_(dmsg)("warning: "
"specified LL cache: line_size %u assoc %u total_size %'u\n",
old_line_size, old_assoc, old_size);
VG_(dmsg)("warning: "
"simulated LL cache: line_size %u assoc %u total_size %'u\n",\
new_line_size, new_assoc, new_size);
LLc->size = new_size;
LLc->assoc = new_assoc;
LLc->line_size = new_line_size;
}
void VG_(post_clo_init_configure_caches)(cache_t* I1c,
cache_t* D1c,
cache_t* LLc,
cache_t* clo_I1c,
cache_t* clo_D1c,
cache_t* clo_LLc)
{
#define DEFINED(L) (-1 != L->size || -1 != L->assoc || -1 != L->line_size)
// Count how many were defined on the command line.
Bool all_caches_clo_defined =
(DEFINED(clo_I1c) &&
DEFINED(clo_D1c) &&
DEFINED(clo_LLc));
// Set the cache config (using auto-detection, if supported by the
// architecture).
configure_caches( I1c, D1c, LLc, all_caches_clo_defined );
maybe_tweak_LLc( LLc );
// Check the default/auto-detected values.
// Allow the user to override invalid auto-detected caches
// with command line.
check_cache_or_override ("I1", I1c, DEFINED(clo_I1c));
check_cache_or_override ("D1", D1c, DEFINED(clo_D1c));
check_cache_or_override ("LL", LLc, DEFINED(clo_LLc));
// Then replace with any defined on the command line. (Already checked in
// VG(parse_clo_cache_opt)().)
if (DEFINED(clo_I1c)) { *I1c = *clo_I1c; }
if (DEFINED(clo_D1c)) { *D1c = *clo_D1c; }
if (DEFINED(clo_LLc)) { *LLc = *clo_LLc; }
if (VG_(clo_verbosity) >= 2) {
VG_(umsg)("Cache configuration used:\n");
umsg_cache_img ("I1", I1c);
umsg_cache_img ("D1", D1c);
umsg_cache_img ("LL", LLc);
}
#undef DEFINED
}
void VG_(print_cache_clo_opts)()
{
VG_(printf)(
" --I1=<size>,<assoc>,<line_size> set I1 cache manually\n"
" --D1=<size>,<assoc>,<line_size> set D1 cache manually\n"
" --LL=<size>,<assoc>,<line_size> set LL cache manually\n"
);
}
// Traverse the cache info and return a cache of the given kind and level.
// Return NULL if no such cache exists.
static const VexCache *
locate_cache(const VexCacheInfo *ci, VexCacheKind kind, UInt level)
{
const VexCache *c;
for (c = ci->caches; c != ci->caches + ci->num_caches; ++c) {
if (c->level == level && c->kind == kind) {
return c;
}
}
return NULL; // not found
}
// Gives the auto-detected configuration of I1, D1 and LL caches. They get
// overridden by any cache configurations specified on the command line.
static void
configure_caches(cache_t *I1c, cache_t *D1c, cache_t *LLc,
Bool all_caches_clo_defined)
{
VexArchInfo vai;
const VexCacheInfo *ci;
const VexCache *i1, *d1, *ll;
VG_(machine_get_VexArchInfo)(NULL, &vai);
ci = &vai.hwcache_info;
// Extract what we need
i1 = locate_cache(ci, INSN_CACHE, 1);
d1 = locate_cache(ci, DATA_CACHE, 1);
ll = locate_cache(ci, UNIFIED_CACHE, ci->num_levels);
if (ci->num_caches > 0 && ll == NULL) {
VG_(dmsg)("warning: L2 cache not installed, ignore LL results.\n");
}
if (ll && ci->num_levels > 2) {
VG_(dmsg)("warning: L%u cache found, using its data for the "
"LL simulation.\n", ci->num_levels);
}
if (i1 && d1 && ll) {
if (i1->is_trace_cache) {
/* HACK ALERT: Instruction trace cache -- capacity is micro-ops based.
* conversion to byte size is a total guess; treat the 12K and 16K
* cases the same since the cache byte size must be a power of two for
* everything to work!. Also guessing 32 bytes for the line size...
*/
UInt adjusted_size, guessed_line_size = 32;
if (i1->sizeB == 12 * 1024 || i1->sizeB == 16 * 1024) {
adjusted_size = 16 * 1024;
} else {
adjusted_size = 32 * 1024;
}
VG_(dmsg)("warning: Pentium 4 with %u KB micro-op instruction trace cache\n",
i1->sizeB / 1024);
VG_(dmsg)(" Simulating a %u KB I-cache with %u B lines\n",
adjusted_size / 1024, guessed_line_size);
*I1c = (cache_t) { adjusted_size, i1->assoc, guessed_line_size };
} else {
*I1c = (cache_t) { i1->sizeB, i1->assoc, i1->line_sizeB };
}
*D1c = (cache_t) { d1->sizeB, d1->assoc, d1->line_sizeB };
*LLc = (cache_t) { ll->sizeB, ll->assoc, ll->line_sizeB };
return;
}
// Cache information could not be queried; choose some default
// architecture specific default setting.
#if defined(VGA_ppc32)
// Default cache configuration
*I1c = (cache_t) { 65536, 2, 64 };
*D1c = (cache_t) { 65536, 2, 64 };
*LLc = (cache_t) { 262144, 8, 64 };
#elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
// Default cache configuration
*I1c = (cache_t) { 65536, 2, 64 };
*D1c = (cache_t) { 65536, 2, 64 };
*LLc = (cache_t) { 262144, 8, 64 };
#elif defined(VGA_arm)
// Set caches to default (for Cortex-A8 ?)
*I1c = (cache_t) { 16384, 4, 64 };
*D1c = (cache_t) { 16384, 4, 64 };
*LLc = (cache_t) { 262144, 8, 64 };
#elif defined(VGA_arm64)
// Copy the 32-bit ARM version until such time as we have
// some real hardware to run on
*I1c = (cache_t) { 16384, 4, 64 };
*D1c = (cache_t) { 16384, 4, 64 };
*LLc = (cache_t) { 262144, 8, 64 };
#elif defined(VGA_s390x)
//
// Here is the cache data from older machine models:
//
// I1 D1 I/D L2
// z900 256k/256/4 256k/256/4 16MB
// z800 256k/256/4 256k/256/4 8MB
// z990 256k/256/4 256k/256/4 32MB
// z890 256k/256/4 256k/256/4 32MB
// z9 256k/256/4 256k/256/4 40MB
//
// Sources:
// (1) IBM System z9 109 Technical Introduction
// www.redbooks.ibm.com/redbooks/pdfs/sg246669.pdf
// (2) The microarchitecture of the IBM eServer z900 processor
// IBM Journal of Research and Development
// Volume 46, Number 4/5, pp 381-395, July/September 2002
// (3) The IBM eServer z990 microprocessor
// IBM Journal of Research and Development
// Volume 48, Number 3/4, pp 295-309, May/July 2004
// (4) Charles Webb, IBM
//
// L2 data is unfortunately incomplete. Otherwise, we could support
// machines without the ECAG insn by looking at VEX_S390X_MODEL(hwcaps).
// Default cache configuration is z10-EC (Source: ECAG insn)
*I1c = (cache_t) { 65536, 4, 256 };
*D1c = (cache_t) { 131072, 8, 256 };
*LLc = (cache_t) { 50331648, 24, 256 };
#elif defined(VGA_mips32)
// Set caches to default (for MIPS32-r2(mips 74kc))
*I1c = (cache_t) { 32768, 4, 32 };
*D1c = (cache_t) { 32768, 4, 32 };
*LLc = (cache_t) { 524288, 8, 32 };
#elif defined(VGA_mips64)
// Set caches to default (for MIPS64 - 5kc)
*I1c = (cache_t) { 32768, 4, 32 };
*D1c = (cache_t) { 32768, 4, 32 };
*LLc = (cache_t) { 524288, 8, 32 };
#elif defined(VGA_x86) || defined(VGA_amd64)
*I1c = (cache_t) { 65536, 2, 64 };
*D1c = (cache_t) { 65536, 2, 64 };
*LLc = (cache_t) { 262144, 8, 64 };
#elif defined(VGA_tilegx)
// Set caches to default for Tilegx.
*I1c = (cache_t) { 0x8000, 2, 64 };
*D1c = (cache_t) { 0x8000, 2, 64 };
*LLc = (cache_t) { 0x40000, 8, 64 };
#else
#error "Unknown arch"
#endif
if (!all_caches_clo_defined) {
const HChar warning[] =
"Warning: Cannot auto-detect cache config, using defaults.\n"
" Run with -v to see.\n";
VG_(dmsg)("%s", warning);
}
}
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
@@ -0,0 +1,74 @@
/*--------------------------------------------------------------------*/
/*--- Arch-specific declarations, cache configuration. cg_arch.h ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Cachegrind, a Valgrind tool for cache
profiling programs.
Copyright (C) 2002-2015 Nicholas Nethercote
njn@valgrind.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __CG_ARCH_H
#define __CG_ARCH_H
// For cache simulation
typedef struct {
Int size; // bytes
Int assoc;
Int line_size; // bytes
} cache_t;
#define MIN_LINE_SIZE 16
// clo_*c used in the call to VG_(str_clo_cache_opt) should be statically
// initialized to UNDEFINED_CACHE.
#define UNDEFINED_CACHE { -1, -1, -1 }
// If arg is a command line option configuring I1 or D1 or LL cache,
// then parses arg to set the relevant cache_t elements.
// Returns True if arg is a cache command line option, False otherwise.
Bool VG_(str_clo_cache_opt)(const HChar *arg,
cache_t* clo_I1c,
cache_t* clo_D1c,
cache_t* clo_LLc);
// Checks the correctness of the auto-detected caches.
// If a cache has been configured by command line options, it
// replaces the equivalent auto-detected cache.
// Note that an invalid auto-detected cache will make Valgrind exit
// with an fatal error, except if the invalid auto-detected cache
// will be replaced by a command line defined cache.
void VG_(post_clo_init_configure_caches)(cache_t* I1c,
cache_t* D1c,
cache_t* LLc,
cache_t* clo_I1c,
cache_t* clo_D1c,
cache_t* clo_LLc);
void VG_(print_cache_clo_opts)(void);
#endif // __CG_ARCH_H
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
@@ -0,0 +1,159 @@
/*--------------------------------------------------------------------*/
/*--- Branch predictor simulation cg_branchpred.c ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Cachegrind, a Valgrind tool for cache
profiling programs.
Copyright (C) 2002-2015 Nicholas Nethercote
njn@valgrind.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
/* This file contains the actual branch predictor simulator and its
associated state. As with cg_sim.c it is #included directly into
cg_main.c. It provides:
- a taken/not-taken predictor for conditional branches
- a branch target address predictor for indirect branches
Function return-address prediction is not modelled, on the basis
that return stack predictors almost always predict correctly, and
also that it is difficult for Valgrind to robustly identify
function calls and returns.
*/
/* How many bits at the bottom of an instruction address are
guaranteed to be zero? */
#if defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le) \
|| defined(VGA_mips32) || defined(VGA_mips64) || defined(VGA_arm64)
# define N_IADDR_LO_ZERO_BITS 2
#elif defined(VGA_x86) || defined(VGA_amd64)
# define N_IADDR_LO_ZERO_BITS 0
#elif defined(VGA_s390x) || defined(VGA_arm)
# define N_IADDR_LO_ZERO_BITS 1
#elif defined(VGA_tilegx)
# define N_IADDR_LO_ZERO_BITS 3
#else
# error "Unsupported architecture"
#endif
/* Get a taken/not-taken prediction for the instruction (presumably a
conditional branch) at instr_addr. Once that's done, update the
predictor state based on whether or not it was actually taken, as
indicated by 'taken'. Finally, return 1 for a mispredict and 0 for
a successful predict.
The predictor is an array of 16k (== 2^14) 2-bit saturating
counters. Given the address of the branch instruction, the array
index to use is computed both from the low order bits of the branch
instruction's address, and the global history - that is, from the
taken/not-taken behaviour of the most recent few branches. This
makes the predictor able to correlate this branch's behaviour with
that of other branches.
TODO: use predictor written by someone who understands this stuff.
Perhaps it would be better to move to a standard GShare predictor
and/or tournament predictor.
*/
/* The index is composed of N_HIST bits at the top and N_IADD bits at
the bottom. These numbers chosen somewhat arbitrarily, but note
that making N_IADD_BITS too small (eg 4) can cause large amounts of
aliasing, and hence misprediction, particularly if the history bits
are mostly unchanging. */
#define N_HIST_BITS 7
#define N_IADD_BITS 7
#define N_BITS (N_HIST_BITS + N_IADD_BITS)
#define N_COUNTERS (1 << N_BITS)
static UWord shift_register = 0; /* Contains global history */
static UChar counters[N_COUNTERS]; /* Counter array; presumably auto-zeroed */
static ULong do_cond_branch_predict ( Addr instr_addr, Word takenW )
{
UWord indx;
Bool predicted_taken, actually_taken, mispredict;
const UWord hist_mask = (1 << N_HIST_BITS) - 1;
const UWord iadd_mask = (1 << N_IADD_BITS) - 1;
UWord hist_bits = shift_register & hist_mask;
UWord iadd_bits = (instr_addr >> N_IADDR_LO_ZERO_BITS)
& iadd_mask;
tl_assert(hist_bits <= hist_mask);
tl_assert(iadd_bits <= iadd_mask);
indx = (hist_bits << N_IADD_BITS) | iadd_bits;
tl_assert(indx < N_COUNTERS);
if (0) VG_(printf)("index = %d\n", (Int)indx);
tl_assert(takenW <= 1);
predicted_taken = counters[ indx ] >= 2;
actually_taken = takenW > 0;
mispredict = (actually_taken && (!predicted_taken))
|| ((!actually_taken) && predicted_taken);
shift_register <<= 1;
shift_register |= (actually_taken ? 1 : 0);
if (actually_taken) {
if (counters[indx] < 3)
counters[indx]++;
} else {
if (counters[indx] > 0)
counters[indx]--;
}
tl_assert(counters[indx] <= 3);
return mispredict ? 1 : 0;
}
/* A very simple indirect branch predictor. Use the branch's address
to index a table which records the previous target address for this
branch (or whatever aliased with it) and use that as the
prediction. */
#define N_BTAC_BITS 9
#define N_BTAC (1 << N_BTAC_BITS)
static Addr btac[N_BTAC]; /* BTAC; presumably auto-zeroed */
static ULong do_ind_branch_predict ( Addr instr_addr, Addr actual )
{
Bool mispredict;
const UWord mask = (1 << N_BTAC_BITS) - 1;
UWord indx = (instr_addr >> N_IADDR_LO_ZERO_BITS)
& mask;
tl_assert(indx < N_BTAC);
mispredict = btac[indx] != actual;
btac[indx] = actual;
return mispredict ? 1 : 0;
}
/*--------------------------------------------------------------------*/
/*--- end cg_branchpred.c ---*/
/*--------------------------------------------------------------------*/
@@ -0,0 +1,339 @@
#! /usr/bin/perl
##--------------------------------------------------------------------##
##--- Cachegrind's differencer. cg_diff.in ---##
##--------------------------------------------------------------------##
# This file is part of Cachegrind, a Valgrind tool for cache
# profiling programs.
#
# Copyright (C) 2002-2015 Nicholas Nethercote
# njn@valgrind.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307, USA.
#
# The GNU General Public License is contained in the file COPYING.
#----------------------------------------------------------------------------
# This is a very cut-down and modified version of cg_annotate.
#----------------------------------------------------------------------------
use warnings;
use strict;
#----------------------------------------------------------------------------
# Global variables
#----------------------------------------------------------------------------
# Version number
my $version = "3.11.0";
# Usage message.
my $usage = <<END
usage: cg_diff [options] <cachegrind-out-file1> <cachegrind-out-file2>
options for the user, with defaults in [ ], are:
-h --help show this message
-v --version show version
--mod-filename=<expr> a Perl search-and-replace expression that is applied
to filenames, eg. --mod-filename='s/prog[0-9]/projN/'
--mod-funcname=<expr> like --mod-filename, but applied to function names
cg_diff is Copyright (C) 2002-2015 Nicholas Nethercote.
and licensed under the GNU General Public License, version 2.
Bug reports, feedback, admiration, abuse, etc, to: njn\@valgrind.org.
END
;
# --mod-filename expression
my $mod_filename = undef;
# --mod-funcname expression
my $mod_funcname = undef;
#-----------------------------------------------------------------------------
# Argument and option handling
#-----------------------------------------------------------------------------
sub process_cmd_line()
{
my ($file1, $file2) = (undef, undef);
for my $arg (@ARGV) {
if ($arg =~ /^-/) {
# --version
if ($arg =~ /^-v$|^--version$/) {
die("cg_diff-$version\n");
} elsif ($arg =~ /^--mod-filename=(.*)/) {
$mod_filename = $1;
} elsif ($arg =~ /^--mod-funcname=(.*)/) {
$mod_funcname = $1;
} else { # -h and --help fall under this case
die($usage);
}
} elsif (not defined($file1)) {
$file1 = $arg;
} elsif (not defined($file2)) {
$file2 = $arg;
} else {
die($usage);
}
}
# Must have specified two input files.
if (not defined $file1 or not defined $file2) {
die($usage);
}
return ($file1, $file2);
}
#-----------------------------------------------------------------------------
# Reading of input file
#-----------------------------------------------------------------------------
sub max ($$)
{
my ($x, $y) = @_;
return ($x > $y ? $x : $y);
}
# Add the two arrays; any '.' entries are ignored. Two tricky things:
# 1. If $a2->[$i] is undefined, it defaults to 0 which is what we want; we turn
# off warnings to allow this. This makes things about 10% faster than
# checking for definedness ourselves.
# 2. We don't add an undefined count or a ".", even though it's value is 0,
# because we don't want to make an $a2->[$i] that is undef become 0
# unnecessarily.
sub add_array_a_to_b ($$)
{
my ($a, $b) = @_;
my $n = max(scalar @$a, scalar @$b);
$^W = 0;
foreach my $i (0 .. $n-1) {
$b->[$i] += $a->[$i] if (defined $a->[$i] && "." ne $a->[$i]);
}
$^W = 1;
}
sub sub_array_b_from_a ($$)
{
my ($a, $b) = @_;
my $n = max(scalar @$a, scalar @$b);
$^W = 0;
foreach my $i (0 .. $n-1) {
$a->[$i] -= $b->[$i]; # XXX: doesn't handle '.' entries
}
$^W = 1;
}
# Add each event count to the CC array. '.' counts become undef, as do
# missing entries (implicitly).
sub line_to_CC ($$)
{
my ($line, $numEvents) = @_;
my @CC = (split /\s+/, $line);
(@CC <= $numEvents) or die("Line $.: too many event counts\n");
return \@CC;
}
sub read_input_file($)
{
my ($input_file) = @_;
open(INPUTFILE, "< $input_file")
|| die "Cannot open $input_file for reading\n";
# Read "desc:" lines.
my $desc;
my $line;
while ($line = <INPUTFILE>) {
if ($line =~ s/desc:\s+//) {
$desc .= $line;
} else {
last;
}
}
# Read "cmd:" line (Nb: will already be in $line from "desc:" loop above).
($line =~ s/^cmd:\s+//) or die("Line $.: missing command line\n");
my $cmd = $line;
chomp($cmd); # Remove newline
# Read "events:" line. We make a temporary hash in which the Nth event's
# value is N, which is useful for handling --show/--sort options below.
$line = <INPUTFILE>;
(defined $line && $line =~ s/^events:\s+//)
or die("Line $.: missing events line\n");
my @events = split(/\s+/, $line);
my $numEvents = scalar @events;
my $currFileName;
my $currFileFuncName;
my %CCs; # hash("$filename#$funcname" => CC array)
my $currCC = undef; # CC array
my $summaryCC;
# Read body of input file.
while (<INPUTFILE>) {
s/#.*$//; # remove comments
if (s/^(\d+)\s+//) {
my $CC = line_to_CC($_, $numEvents);
defined($currCC) || die;
add_array_a_to_b($CC, $currCC);
} elsif (s/^fn=(.*)$//) {
defined($currFileName) || die;
my $tmpFuncName = $1;
if (defined $mod_funcname) {
eval "\$tmpFuncName =~ $mod_funcname";
}
$currFileFuncName = "$currFileName#$tmpFuncName";
$currCC = $CCs{$currFileFuncName};
if (not defined $currCC) {
$currCC = [];
$CCs{$currFileFuncName} = $currCC;
}
} elsif (s/^fl=(.*)$//) {
$currFileName = $1;
if (defined $mod_filename) {
eval "\$currFileName =~ $mod_filename";
}
# Assume that a "fn=" line is followed by a "fl=" line.
$currFileFuncName = undef;
} elsif (s/^\s*$//) {
# blank, do nothing
} elsif (s/^summary:\s+//) {
$summaryCC = line_to_CC($_, $numEvents);
(scalar(@$summaryCC) == @events)
or die("Line $.: summary event and total event mismatch\n");
} else {
warn("WARNING: line $. malformed, ignoring\n");
}
}
# Check if summary line was present
if (not defined $summaryCC) {
die("missing final summary line, aborting\n");
}
close(INPUTFILE);
return ($cmd, \@events, \%CCs, $summaryCC);
}
#----------------------------------------------------------------------------
# "main()"
#----------------------------------------------------------------------------
# Commands seen in the files. Need not match.
my $cmd1;
my $cmd2;
# Events seen in the files. They must match.
my $events1;
my $events2;
# Individual CCs, organised by filename/funcname/line_num.
# hashref("$filename#$funcname", CC array)
my $CCs1;
my $CCs2;
# Total counts for summary (an arrayref).
my $summaryCC1;
my $summaryCC2;
#----------------------------------------------------------------------------
# Read the input files
#----------------------------------------------------------------------------
my ($file1, $file2) = process_cmd_line();
($cmd1, $events1, $CCs1, $summaryCC1) = read_input_file($file1);
($cmd2, $events2, $CCs2, $summaryCC2) = read_input_file($file2);
#----------------------------------------------------------------------------
# Check the events match
#----------------------------------------------------------------------------
my $n = max(scalar @$events1, scalar @$events2);
$^W = 0; # turn off warnings, because we might hit undefs
foreach my $i (0 .. $n-1) {
($events1->[$i] eq $events2->[$i]) || die "events don't match, aborting\n";
}
$^W = 1;
#----------------------------------------------------------------------------
# Do the subtraction: CCs2 -= CCs1
#----------------------------------------------------------------------------
while (my ($filefuncname, $CC1) = each(%$CCs1)) {
my $CC2 = $CCs2->{$filefuncname};
if (not defined $CC2) {
$CC2 = [];
sub_array_b_from_a($CC2, $CC1); # CC2 -= CC1
$CCs2->{$filefuncname} = $CC2;
} else {
sub_array_b_from_a($CC2, $CC1); # CC2 -= CC1
}
}
sub_array_b_from_a($summaryCC2, $summaryCC1);
#----------------------------------------------------------------------------
# Print the result, in CCs2
#----------------------------------------------------------------------------
print("desc: Files compared: $file1; $file2\n");
print("cmd: $cmd1; $cmd2\n");
print("events: ");
for my $e (@$events1) {
print(" $e");
}
print("\n");
while (my ($filefuncname, $CC) = each(%$CCs2)) {
my @x = split(/#/, $filefuncname);
(scalar @x == 2) || die;
print("fl=$x[0]\n");
print("fn=$x[1]\n");
print("0");
foreach my $n (@$CC) {
print(" $n");
}
print("\n");
}
print("summary:");
foreach my $n (@$summaryCC2) {
print(" $n");
}
print("\n");
##--------------------------------------------------------------------##
##--- end ---##
##--------------------------------------------------------------------##
+339
View File
@@ -0,0 +1,339 @@
#! @PERL@
##--------------------------------------------------------------------##
##--- Cachegrind's differencer. cg_diff.in ---##
##--------------------------------------------------------------------##
# This file is part of Cachegrind, a Valgrind tool for cache
# profiling programs.
#
# Copyright (C) 2002-2015 Nicholas Nethercote
# njn@valgrind.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307, USA.
#
# The GNU General Public License is contained in the file COPYING.
#----------------------------------------------------------------------------
# This is a very cut-down and modified version of cg_annotate.
#----------------------------------------------------------------------------
use warnings;
use strict;
#----------------------------------------------------------------------------
# Global variables
#----------------------------------------------------------------------------
# Version number
my $version = "@VERSION@";
# Usage message.
my $usage = <<END
usage: cg_diff [options] <cachegrind-out-file1> <cachegrind-out-file2>
options for the user, with defaults in [ ], are:
-h --help show this message
-v --version show version
--mod-filename=<expr> a Perl search-and-replace expression that is applied
to filenames, eg. --mod-filename='s/prog[0-9]/projN/'
--mod-funcname=<expr> like --mod-filename, but applied to function names
cg_diff is Copyright (C) 2002-2015 Nicholas Nethercote.
and licensed under the GNU General Public License, version 2.
Bug reports, feedback, admiration, abuse, etc, to: njn\@valgrind.org.
END
;
# --mod-filename expression
my $mod_filename = undef;
# --mod-funcname expression
my $mod_funcname = undef;
#-----------------------------------------------------------------------------
# Argument and option handling
#-----------------------------------------------------------------------------
sub process_cmd_line()
{
my ($file1, $file2) = (undef, undef);
for my $arg (@ARGV) {
if ($arg =~ /^-/) {
# --version
if ($arg =~ /^-v$|^--version$/) {
die("cg_diff-$version\n");
} elsif ($arg =~ /^--mod-filename=(.*)/) {
$mod_filename = $1;
} elsif ($arg =~ /^--mod-funcname=(.*)/) {
$mod_funcname = $1;
} else { # -h and --help fall under this case
die($usage);
}
} elsif (not defined($file1)) {
$file1 = $arg;
} elsif (not defined($file2)) {
$file2 = $arg;
} else {
die($usage);
}
}
# Must have specified two input files.
if (not defined $file1 or not defined $file2) {
die($usage);
}
return ($file1, $file2);
}
#-----------------------------------------------------------------------------
# Reading of input file
#-----------------------------------------------------------------------------
sub max ($$)
{
my ($x, $y) = @_;
return ($x > $y ? $x : $y);
}
# Add the two arrays; any '.' entries are ignored. Two tricky things:
# 1. If $a2->[$i] is undefined, it defaults to 0 which is what we want; we turn
# off warnings to allow this. This makes things about 10% faster than
# checking for definedness ourselves.
# 2. We don't add an undefined count or a ".", even though it's value is 0,
# because we don't want to make an $a2->[$i] that is undef become 0
# unnecessarily.
sub add_array_a_to_b ($$)
{
my ($a, $b) = @_;
my $n = max(scalar @$a, scalar @$b);
$^W = 0;
foreach my $i (0 .. $n-1) {
$b->[$i] += $a->[$i] if (defined $a->[$i] && "." ne $a->[$i]);
}
$^W = 1;
}
sub sub_array_b_from_a ($$)
{
my ($a, $b) = @_;
my $n = max(scalar @$a, scalar @$b);
$^W = 0;
foreach my $i (0 .. $n-1) {
$a->[$i] -= $b->[$i]; # XXX: doesn't handle '.' entries
}
$^W = 1;
}
# Add each event count to the CC array. '.' counts become undef, as do
# missing entries (implicitly).
sub line_to_CC ($$)
{
my ($line, $numEvents) = @_;
my @CC = (split /\s+/, $line);
(@CC <= $numEvents) or die("Line $.: too many event counts\n");
return \@CC;
}
sub read_input_file($)
{
my ($input_file) = @_;
open(INPUTFILE, "< $input_file")
|| die "Cannot open $input_file for reading\n";
# Read "desc:" lines.
my $desc;
my $line;
while ($line = <INPUTFILE>) {
if ($line =~ s/desc:\s+//) {
$desc .= $line;
} else {
last;
}
}
# Read "cmd:" line (Nb: will already be in $line from "desc:" loop above).
($line =~ s/^cmd:\s+//) or die("Line $.: missing command line\n");
my $cmd = $line;
chomp($cmd); # Remove newline
# Read "events:" line. We make a temporary hash in which the Nth event's
# value is N, which is useful for handling --show/--sort options below.
$line = <INPUTFILE>;
(defined $line && $line =~ s/^events:\s+//)
or die("Line $.: missing events line\n");
my @events = split(/\s+/, $line);
my $numEvents = scalar @events;
my $currFileName;
my $currFileFuncName;
my %CCs; # hash("$filename#$funcname" => CC array)
my $currCC = undef; # CC array
my $summaryCC;
# Read body of input file.
while (<INPUTFILE>) {
s/#.*$//; # remove comments
if (s/^(\d+)\s+//) {
my $CC = line_to_CC($_, $numEvents);
defined($currCC) || die;
add_array_a_to_b($CC, $currCC);
} elsif (s/^fn=(.*)$//) {
defined($currFileName) || die;
my $tmpFuncName = $1;
if (defined $mod_funcname) {
eval "\$tmpFuncName =~ $mod_funcname";
}
$currFileFuncName = "$currFileName#$tmpFuncName";
$currCC = $CCs{$currFileFuncName};
if (not defined $currCC) {
$currCC = [];
$CCs{$currFileFuncName} = $currCC;
}
} elsif (s/^fl=(.*)$//) {
$currFileName = $1;
if (defined $mod_filename) {
eval "\$currFileName =~ $mod_filename";
}
# Assume that a "fn=" line is followed by a "fl=" line.
$currFileFuncName = undef;
} elsif (s/^\s*$//) {
# blank, do nothing
} elsif (s/^summary:\s+//) {
$summaryCC = line_to_CC($_, $numEvents);
(scalar(@$summaryCC) == @events)
or die("Line $.: summary event and total event mismatch\n");
} else {
warn("WARNING: line $. malformed, ignoring\n");
}
}
# Check if summary line was present
if (not defined $summaryCC) {
die("missing final summary line, aborting\n");
}
close(INPUTFILE);
return ($cmd, \@events, \%CCs, $summaryCC);
}
#----------------------------------------------------------------------------
# "main()"
#----------------------------------------------------------------------------
# Commands seen in the files. Need not match.
my $cmd1;
my $cmd2;
# Events seen in the files. They must match.
my $events1;
my $events2;
# Individual CCs, organised by filename/funcname/line_num.
# hashref("$filename#$funcname", CC array)
my $CCs1;
my $CCs2;
# Total counts for summary (an arrayref).
my $summaryCC1;
my $summaryCC2;
#----------------------------------------------------------------------------
# Read the input files
#----------------------------------------------------------------------------
my ($file1, $file2) = process_cmd_line();
($cmd1, $events1, $CCs1, $summaryCC1) = read_input_file($file1);
($cmd2, $events2, $CCs2, $summaryCC2) = read_input_file($file2);
#----------------------------------------------------------------------------
# Check the events match
#----------------------------------------------------------------------------
my $n = max(scalar @$events1, scalar @$events2);
$^W = 0; # turn off warnings, because we might hit undefs
foreach my $i (0 .. $n-1) {
($events1->[$i] eq $events2->[$i]) || die "events don't match, aborting\n";
}
$^W = 1;
#----------------------------------------------------------------------------
# Do the subtraction: CCs2 -= CCs1
#----------------------------------------------------------------------------
while (my ($filefuncname, $CC1) = each(%$CCs1)) {
my $CC2 = $CCs2->{$filefuncname};
if (not defined $CC2) {
$CC2 = [];
sub_array_b_from_a($CC2, $CC1); # CC2 -= CC1
$CCs2->{$filefuncname} = $CC2;
} else {
sub_array_b_from_a($CC2, $CC1); # CC2 -= CC1
}
}
sub_array_b_from_a($summaryCC2, $summaryCC1);
#----------------------------------------------------------------------------
# Print the result, in CCs2
#----------------------------------------------------------------------------
print("desc: Files compared: $file1; $file2\n");
print("cmd: $cmd1; $cmd2\n");
print("events: ");
for my $e (@$events1) {
print(" $e");
}
print("\n");
while (my ($filefuncname, $CC) = each(%$CCs2)) {
my @x = split(/#/, $filefuncname);
(scalar @x == 2) || die;
print("fl=$x[0]\n");
print("fn=$x[1]\n");
print("0");
foreach my $n (@$CC) {
print(" $n");
}
print("\n");
}
print("summary:");
foreach my $n (@$summaryCC2) {
print(" $n");
}
print("\n");
##--------------------------------------------------------------------##
##--- end ---##
##--------------------------------------------------------------------##
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,239 @@
/*--------------------------------------------------------------------*/
/*--- Cache simulation cg_sim.c ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Cachegrind, a Valgrind tool for cache
profiling programs.
Copyright (C) 2002-2015 Nicholas Nethercote
njn@valgrind.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
/* Notes:
- simulates a write-allocate cache
- (block --> set) hash function uses simple bit selection
- handling of references straddling two cache blocks:
- counts as only one cache access (not two)
- both blocks hit --> one hit
- one block hits, the other misses --> one miss
- both blocks miss --> one miss (not two)
*/
typedef struct {
Int size; /* bytes */
Int assoc;
Int line_size; /* bytes */
Int sets;
Int sets_min_1;
Int line_size_bits;
Int tag_shift;
HChar desc_line[128]; /* large enough */
UWord* tags;
} cache_t2;
/* By this point, the size/assoc/line_size has been checked. */
static void cachesim_initcache(cache_t config, cache_t2* c)
{
Int i;
c->size = config.size;
c->assoc = config.assoc;
c->line_size = config.line_size;
c->sets = (c->size / c->line_size) / c->assoc;
c->sets_min_1 = c->sets - 1;
c->line_size_bits = VG_(log2)(c->line_size);
c->tag_shift = c->line_size_bits + VG_(log2)(c->sets);
if (c->assoc == 1) {
VG_(sprintf)(c->desc_line, "%d B, %d B, direct-mapped",
c->size, c->line_size);
} else {
VG_(sprintf)(c->desc_line, "%d B, %d B, %d-way associative",
c->size, c->line_size, c->assoc);
}
c->tags = VG_(malloc)("cg.sim.ci.1",
sizeof(UWord) * c->sets * c->assoc);
for (i = 0; i < c->sets * c->assoc; i++)
c->tags[i] = 0;
}
/* This attribute forces GCC to inline the function, getting rid of a
* lot of indirection around the cache_t2 pointer, if it is known to be
* constant in the caller (the caller is inlined itself).
* Without inlining of simulator functions, cachegrind can get 40% slower.
*/
__attribute__((always_inline))
static __inline__
Bool cachesim_setref_is_miss(cache_t2* c, UInt set_no, UWord tag)
{
int i, j;
UWord *set;
set = &(c->tags[set_no * c->assoc]);
/* This loop is unrolled for just the first case, which is the most */
/* common. We can't unroll any further because it would screw up */
/* if we have a direct-mapped (1-way) cache. */
if (tag == set[0])
return False;
/* If the tag is one other than the MRU, move it into the MRU spot */
/* and shuffle the rest down. */
for (i = 1; i < c->assoc; i++) {
if (tag == set[i]) {
for (j = i; j > 0; j--) {
set[j] = set[j - 1];
}
set[0] = tag;
return False;
}
}
/* A miss; install this tag as MRU, shuffle rest down. */
for (j = c->assoc - 1; j > 0; j--) {
set[j] = set[j - 1];
}
set[0] = tag;
return True;
}
__attribute__((always_inline))
static __inline__
Bool cachesim_ref_is_miss(cache_t2* c, Addr a, UChar size)
{
/* A memory block has the size of a cache line */
UWord block1 = a >> c->line_size_bits;
UWord block2 = (a+size-1) >> c->line_size_bits;
UInt set1 = block1 & c->sets_min_1;
/* Tags used in real caches are minimal to save space.
* As the last bits of the block number of addresses mapping
* into one cache set are the same, real caches use as tag
* tag = block >> log2(#sets)
* But using the memory block as more specific tag is fine,
* and saves instructions.
*/
UWord tag1 = block1;
/* Access entirely within line. */
if (block1 == block2)
return cachesim_setref_is_miss(c, set1, tag1);
/* Access straddles two lines. */
else if (block1 + 1 == block2) {
UInt set2 = block2 & c->sets_min_1;
UWord tag2 = block2;
/* always do both, as state is updated as side effect */
if (cachesim_setref_is_miss(c, set1, tag1)) {
cachesim_setref_is_miss(c, set2, tag2);
return True;
}
return cachesim_setref_is_miss(c, set2, tag2);
}
VG_(printf)("addr: %lx size: %u blocks: %lu %lu",
a, size, block1, block2);
VG_(tool_panic)("item straddles more than two cache sets");
/* not reached */
return True;
}
static cache_t2 LL;
static cache_t2 I1;
static cache_t2 D1;
static void cachesim_initcaches(cache_t I1c, cache_t D1c, cache_t LLc)
{
cachesim_initcache(I1c, &I1);
cachesim_initcache(D1c, &D1);
cachesim_initcache(LLc, &LL);
}
__attribute__((always_inline))
static __inline__
void cachesim_I1_doref_Gen(Addr a, UChar size, ULong* m1, ULong *mL)
{
if (cachesim_ref_is_miss(&I1, a, size)) {
(*m1)++;
if (cachesim_ref_is_miss(&LL, a, size))
(*mL)++;
}
}
// common special case IrNoX
__attribute__((always_inline))
static __inline__
void cachesim_I1_doref_NoX(Addr a, UChar size, ULong* m1, ULong *mL)
{
UWord block = a >> I1.line_size_bits;
UInt I1_set = block & I1.sets_min_1;
// use block as tag
if (cachesim_setref_is_miss(&I1, I1_set, block)) {
UInt LL_set = block & LL.sets_min_1;
(*m1)++;
// can use block as tag as L1I and LL cache line sizes are equal
if (cachesim_setref_is_miss(&LL, LL_set, block))
(*mL)++;
}
}
__attribute__((always_inline))
static __inline__
void cachesim_D1_doref(Addr a, UChar size, ULong* m1, ULong *mL)
{
if (cachesim_ref_is_miss(&D1, a, size)) {
(*m1)++;
if (cachesim_ref_is_miss(&LL, a, size))
(*mL)++;
}
}
/* Check for special case IrNoX. Called at instrumentation time.
*
* Does this Ir only touch one cache line, and are L1I/LL cache
* line sizes the same? This allows to get rid of a runtime check.
*
* Returning false is always fine, as this calls the generic case
*/
static Bool cachesim_is_IrNoX(Addr a, UChar size)
{
UWord block1, block2;
if (I1.line_size_bits != LL.line_size_bits) return False;
block1 = a >> I1.line_size_bits;
block2 = (a+size-1) >> I1.line_size_bits;
if (block1 != block2) return False;
return True;
}
/*--------------------------------------------------------------------*/
/*--- end cg_sim.c ---*/
/*--------------------------------------------------------------------*/
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,74 @@
<?xml version="1.0"?> <!-- -*- sgml -*- -->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[ <!ENTITY % vg-entities SYSTEM "../../docs/xml/vg-entities.xml"> %vg-entities; ]>
<refentry id="cg_annotate">
<refmeta>
<refentrytitle>cg_annotate</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Release &rel-version;</refmiscinfo>
</refmeta>
<refnamediv>
<refname>cg_annotate</refname>
<refpurpose>post-processing tool for Cachegrind</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>cg_annotate</command>
<arg><replaceable>options</replaceable></arg>
<arg choice="plain"><replaceable>cachegrind-out-file</replaceable></arg>
<arg choice="opt" rep="repeat"><replaceable>source-files</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="description">
<title>Description</title>
<para><command>cg_annotate</command> takes an output file produced by the
Valgrind tool Cachegrind and prints the information in an easy-to-read form.
</para>
</refsect1>
<refsect1 id="options">
<title>Options</title>
<xi:include href="cg-manual.xml" xpointer="cg_annotate.opts.list"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</refsect1>
<refsect1 id="see_also">
<title>See Also</title>
<para>
valgrind(1),
<filename>&vg-docs-path;</filename> or
<filename>&vg-docs-url;</filename>.
</para>
</refsect1>
<refsect1 id="author">
<title>Author</title>
<para>Nicholas Nethercote.</para>
</refsect1>
</refentry>
@@ -0,0 +1,75 @@
<?xml version="1.0"?> <!-- -*- sgml -*- -->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[ <!ENTITY % vg-entities SYSTEM "../../docs/xml/vg-entities.xml"> %vg-entities; ]>
<refentry id="cg_diff">
<refmeta>
<refentrytitle>cg_diff</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Release &rel-version;</refmiscinfo>
</refmeta>
<refnamediv>
<refname>cg_diff</refname>
<refpurpose>compares two Cachegrind output files</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>cg_diff</command>
<arg><replaceable>options</replaceable></arg>
<arg choice="plain"><replaceable>cachegrind-out-file1</replaceable></arg>
<arg choice="plain"><replaceable>cachegrind-out-file2</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="description">
<title>Description</title>
<para><command>cg_diff</command> takes two output files produced by the
Valgrind tool Cachegrind, computes the difference and prints the result
in the same format that Cachegrinds outputs.
</para>
</refsect1>
<refsect1 id="options">
<title>Options</title>
<xi:include href="cg-manual.xml" xpointer="cg_diff.opts.list"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</refsect1>
<refsect1 id="see_also">
<title>See Also</title>
<para>
cg_annotate(1), valgrind(1),
<filename>&vg-docs-path;</filename> or
<filename>&vg-docs-url;</filename>.
</para>
</refsect1>
<refsect1 id="author">
<title>Author</title>
<para>Nicholas Nethercote.</para>
</refsect1>
</refentry>
@@ -0,0 +1,73 @@
<?xml version="1.0"?> <!-- -*- sgml -*- -->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[ <!ENTITY % vg-entities SYSTEM "../../docs/xml/vg-entities.xml"> %vg-entities; ]>
<refentry id="cg_merge">
<refmeta>
<refentrytitle>cg_merge</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Release &rel-version;</refmiscinfo>
</refmeta>
<refnamediv>
<refname>cg_merge</refname>
<refpurpose>merges multiple Cachegrind output files into one</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>cg_merge</command>
<arg><replaceable>options</replaceable></arg>
<arg choice="opt" rep="repeat"><replaceable>cachegrind-out-files</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="description">
<title>Description</title>
<para><command>cg_merge</command> sums together the outputs of multiple
Cachegrind runs into a single output file.
</para>
</refsect1>
<refsect1 id="options">
<title>Options</title>
<xi:include href="cg-manual.xml" xpointer="cg_merge.opts.list"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</refsect1>
<refsect1 id="see_also">
<title>See Also</title>
<para>
cg_annotate(1), valgrind(1),
<filename>&vg-docs-path;</filename> or
<filename>&vg-docs-url;</filename>.
</para>
</refsect1>
<refsect1 id="author">
<title>Author</title>
<para>Nicholas Nethercote.</para>
</refsect1>
</refentry>
@@ -0,0 +1 @@
# dummy
@@ -0,0 +1 @@
# dummy
@@ -0,0 +1 @@
# dummy
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,33 @@
include $(top_srcdir)/Makefile.tool-tests.am
SUBDIRS = .
if VGCONF_ARCHS_INCLUDE_X86
SUBDIRS += x86
endif
DIST_SUBDIRS = x86 .
dist_noinst_SCRIPTS = filter_stderr filter_cachesim_discards
EXTRA_DIST = \
chdir.vgtest chdir.stderr.exp \
clreq.vgtest clreq.stderr.exp \
dlclose.vgtest dlclose.stderr.exp dlclose.stdout.exp \
notpower2.vgtest notpower2.stderr.exp \
wrap5.vgtest wrap5.stderr.exp wrap5.stdout.exp
check_PROGRAMS = \
chdir clreq dlclose myprint.so
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
# C ones
dlclose_LDADD = -ldl
if VGCONF_OS_IS_DARWIN
myprint_so_LDFLAGS = $(AM_CFLAGS) -dynamic -dynamiclib -all_load -fpic
else
myprint_so_LDFLAGS = $(AM_CFLAGS) -shared -fPIC
endif
myprint_so_CFLAGS = $(AM_CFLAGS) -fPIC
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,10 @@
#include <unistd.h>
// Before the bug was fixed, if a program changed working directory, things
// would break and the cachegrind.out.<pid> file wouldn't get written.
int main(void)
{
chdir("..");
return 0;
}
@@ -0,0 +1,17 @@
I refs:
I1 misses:
LLi misses:
I1 miss rate:
LLi miss rate:
D refs:
D1 misses:
LLd misses:
D1 miss rate:
LLd miss rate:
LL refs:
LL misses:
LL miss rate:
@@ -0,0 +1,2 @@
prog: chdir
cleanup: rm cachegrind.out.*
@@ -0,0 +1,11 @@
// Prior to 3.0.1, Cachegrind was failing if run on a program that uses
// client requests. It was fixed in 3.0.1, but then reintroduced
// afterwards (reported as bug #116057). So here we test it.
#include "../../include/valgrind.h"
int main(void)
{
return RUNNING_ON_VALGRIND;
}
@@ -0,0 +1,3 @@
prog: clreq
vgopts: -q
cleanup: rm cachegrind.out.*
@@ -0,0 +1,38 @@
/* This exercises the code that was causing this bug:
valgrind: vg_cachesim.c:389 (get_BBCC): Assertion `((Bool)0) == remove'
failed.
in Cachegrind 1.0.0 and 1.0.1, that was caused by unloading symbols before
invalidating translations.
*/
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
int main(int argc, char **argv) {
void *handle;
void (*myprint)(void);
char *error;
handle = dlopen ("./myprint.so", RTLD_LAZY);
if (!handle) {
fputs (dlerror(), stderr);
exit(1);
}
myprint = dlsym(handle, "myprint");
if ((error = dlerror()) != NULL) {
fprintf (stderr, "%s\n", error);
exit(1);
}
(*myprint)();
/* Assertion failure was happening here */
dlclose(handle);
return 0;
}
@@ -0,0 +1,17 @@
I refs:
I1 misses:
LLi misses:
I1 miss rate:
LLi miss rate:
D refs:
D1 misses:
LLd misses:
D1 miss rate:
LLd miss rate:
LL refs:
LL misses:
LL miss rate:
@@ -0,0 +1 @@
This is myprint!
@@ -0,0 +1,3 @@
prog: dlclose
stderr_filter: filter_cachesim_discards
cleanup: rm cachegrind.out.*
@@ -0,0 +1,8 @@
#! /bin/sh
dir=`dirname $0`
$dir/filter_stderr |
# Anonymise paths like "/local/foo/bar/tests/baz/quux" (note "tests" is there)
sed "s/\/.*\/tests\//\/...\/tests\//"
@@ -0,0 +1,25 @@
#! /bin/sh
dir=`dirname $0`
$dir/../../tests/filter_stderr_basic |
# Remove "Cachegrind, ..." line and the following copyright line.
sed "/^Cachegrind, a cache and branch-prediction profiler/ , /./ d" |
# Remove numbers from I/D/LL "refs:" lines
perl -p -e 's/((I|D|LL) *refs:)[ 0-9,()+rdw]*$/\1/' |
# Remove numbers from I1/D1/LL/LLi/LLd "misses:" and "miss rates:" lines
perl -p -e 's/((I1|D1|LL|LLi|LLd) *(misses|miss rate):)[ 0-9,()+rdw%\.]*$/\1/' |
# Remove CPUID warnings lines for P4s and other machines
sed "/warning: Pentium 4 with 12 KB micro-op instruction trace cache/d" |
sed "/Simulating a 16 KB I-cache with 32 B lines/d" |
sed "/warning: L3 cache found, using its data for the LL simulation./d" |
sed "/warning: L4 cache found, using its data for the LL simulation./d" |
sed "/Warning: Cannot auto-detect cache config, using defaults./d" |
sed "/Run with -v to see./d" |
sed "/warning: specified LL cache: line_size .*$/d" |
sed "/warning: simulated LL cache: line_size .*$/d"
@@ -0,0 +1,6 @@
#include <stdio.h>
void myprint(void)
{
puts("This is myprint!");
}
@@ -0,0 +1,17 @@
I refs:
I1 misses:
LLi misses:
I1 miss rate:
LLi miss rate:
D refs:
D1 misses:
LLd misses:
D1 miss rate:
LLd miss rate:
LL refs:
LL misses:
LL miss rate:
@@ -0,0 +1,3 @@
prog: ../../tests/true
vgopts: --I1=32768,8,64 --D1=24576,6,64 --LL=3145728,12,64
cleanup: rm cachegrind.out.*
@@ -0,0 +1,17 @@
I refs:
I1 misses:
LLi misses:
I1 miss rate:
LLi miss rate:
D refs:
D1 misses:
LLd misses:
D1 miss rate:
LLd miss rate:
LL refs:
LL misses:
LL miss rate:
@@ -0,0 +1,37 @@
computing fact1(7)
in wrapper1-pre: fact(7)
in wrapper2-pre: fact(6)
in wrapper1-pre: fact(5)
in wrapper2-pre: fact(4)
in wrapper1-pre: fact(3)
in wrapper2-pre: fact(2)
in wrapper1-pre: fact(1)
in wrapper2-pre: fact(0)
in wrapper2-post: fact(0) = 1
in wrapper1-post: fact(1) = 1
in wrapper2-post: fact(2) = 2
in wrapper1-post: fact(3) = 6
in wrapper2-pre: fact(2)
in wrapper1-pre: fact(1)
in wrapper2-pre: fact(0)
in wrapper2-post: fact(0) = 1
in wrapper1-post: fact(1) = 1
in wrapper2-post: fact(2) = 2
in wrapper2-post: fact(4) = 32
in wrapper1-post: fact(5) = 160
in wrapper2-pre: fact(2)
in wrapper1-pre: fact(1)
in wrapper2-pre: fact(0)
in wrapper2-post: fact(0) = 1
in wrapper1-post: fact(1) = 1
in wrapper2-post: fact(2) = 2
in wrapper2-post: fact(6) = 972
in wrapper1-post: fact(7) = 6804
in wrapper2-pre: fact(2)
in wrapper1-pre: fact(1)
in wrapper2-pre: fact(0)
in wrapper2-post: fact(0) = 1
in wrapper1-post: fact(1) = 1
in wrapper2-post: fact(2) = 2
fact1(7) = 6806
allocated 51 Lards
@@ -0,0 +1,2 @@
prog: ../../memcheck/tests/wrap5
cleanup: rm cachegrind.out.*
@@ -0,0 +1 @@
# dummy
@@ -0,0 +1,915 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# cachegrind/tests/x86/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# This file is used for tool tests, and also in perf/Makefile.am.
# This file should be included (directly or indirectly) by every
# Makefile.am that builds programs. And also the top-level Makefile.am.
#----------------------------------------------------------------------------
# Global stuff
#----------------------------------------------------------------------------
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/valgrind
pkgincludedir = $(includedir)/valgrind
pkglibdir = $(libdir)/valgrind
pkglibexecdir = $(libexecdir)/valgrind
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-linux-gnu
host_triplet = i686-pc-linux-gnu
DIST_COMMON = $(top_srcdir)/Makefile.tool-tests.am \
$(top_srcdir)/Makefile.all.am $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(dist_noinst_SCRIPTS) \
$(top_srcdir)/depcomp
#am__append_1 = -Wno-cast-align -Wno-self-assign \
# -Wno-tautological-compare
#am__append_2 = -Wl,-M,$(top_srcdir)/solaris/vgpreload-solaris.mapfile
# The Android toolchain includes all kinds of stdlib helpers present in
# bionic which is bad because we are not linking with it and the Android
# linker will panic.
#am__append_3 = -nostdlib
#am__append_4 = -DVGA_SEC_=1 \
# -DVGP_SEC_x86_linux=1
# Make sure that all test programs have threaded errno.
#am__append_5 = -D_REENTRANT
#am__append_6 = -Wno-format-extra-args \
# -Wno-literal-range \
# -Wno-tautological-constant-out-of-range-compare \
# -Wno-self-assign -Wno-string-plus-int \
# -Wno-uninitialized -Wno-unused-value # \
# clang 3.0.0
#am__append_7 = -Wno-unused-private-field # drd/tests/tsan_unittest.cpp
check_PROGRAMS = fpu-28-108$(EXEEXT)
subdir = cachegrind/tests/x86
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am_fpu_28_108_OBJECTS = fpu-28-108.$(OBJEXT)
fpu_28_108_OBJECTS = $(am_fpu_28_108_OBJECTS)
fpu_28_108_LDADD = $(LDADD)
SCRIPTS = $(dist_noinst_SCRIPTS)
AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I. -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
AM_V_CPPAS = $(am__v_CPPAS_$(V))
am__v_CPPAS_ = $(am__v_CPPAS_$(AM_DEFAULT_VERBOSITY))
am__v_CPPAS_0 = @echo " CPPAS " $@;
am__v_CPPAS_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_$(V))
am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_$(V))
am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(fpu_28_108_SOURCES)
DIST_SOURCES = $(fpu_28_108_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /root/03_day/valgrind-3.11.0/missing aclocal-1.14
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AR = /usr/bin/ar
AUTOCONF = ${SHELL} /root/03_day/valgrind-3.11.0/missing autoconf
AUTOHEADER = ${SHELL} /root/03_day/valgrind-3.11.0/missing autoheader
AUTOMAKE = ${SHELL} /root/03_day/valgrind-3.11.0/missing automake-1.14
AWK = gawk
BOOST_CFLAGS =
BOOST_LIBS =
CC = gcc
CCAS = gcc
CCASDEPMODE = depmode=gcc3
CCASFLAGS =
CCDEPMODE = depmode=gcc3
CFLAGS =
CFLAGS_MPI = -g -O -fno-omit-frame-pointer -Wall -fpic
CPP = gcc -E
CPPFLAGS =
CXX = g++
CXXDEPMODE = depmode=gcc3
CXXFLAGS =
CYGPATH_W = echo
DEFAULT_SUPP = exp-sgcheck.supp xfree-3.supp xfree-4.supp glibc-2.X-drd.supp glibc-2.34567-NPTL-helgrind.supp glibc-2.X.supp
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DIFF = diff -u
DIS_PATH =
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /bin/grep -E
EXEEXT =
FLAG_FNO_IPA_ICF = -fno-ipa-icf
FLAG_FNO_STACK_PROTECTOR = -fno-stack-protector
FLAG_FSANITIZE =
FLAG_M32 = -m32
FLAG_M64 = -m64
FLAG_MIPS32 =
FLAG_MIPS64 =
FLAG_MLONG_DOUBLE_128 = -mlong-double-128
FLAG_MMMX = -mmmx
FLAG_MSSE = -msse
FLAG_NO_BUILD_ID =
FLAG_OCTEON =
FLAG_OCTEON2 =
FLAG_T_TEXT = -Ttext-segment
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = --param inline-unit-growth=900
FLAG_W_CAST_ALIGN = -Wcast-align
FLAG_W_CAST_QUAL = -Wcast-qual
FLAG_W_EMPTY_BODY = -Wempty-body
FLAG_W_EXTRA = -Wextra
FLAG_W_FORMAT = -Wformat
FLAG_W_FORMAT_SECURITY = -Wformat-security
FLAG_W_FORMAT_SIGNEDNESS =
FLAG_W_IGNORED_QUALIFIERS = -Wignored-qualifiers
FLAG_W_MISSING_PARAMETER_TYPE = -Wmissing-parameter-type
FLAG_W_NO_INFINITE_RECURSION =
FLAG_W_NO_MEMSET_TRANSPOSED_ARGS = -Wno-memset-transposed-args
FLAG_W_NO_MISMATCHED_NEW_DELETE =
FLAG_W_NO_NONNULL = -Wno-nonnull
FLAG_W_NO_OVERFLOW = -Wno-overflow
FLAG_W_NO_POINTER_SIGN = -Wno-pointer-sign
FLAG_W_NO_STATIC_LOCAL_IN_INLINE =
FLAG_W_NO_UNINITIALIZED = -Wno-uninitialized
FLAG_W_NO_UNUSED_FUNCTION = -Wno-unused-function
FLAG_W_OLD_STYLE_DECLARATION = -Wold-style-declaration
FLAG_W_WRITE_STRINGS = -Wwrite-strings
GDB = /usr/bin/gdb
GLIBC_VERSION = 2.21
GREP = /bin/grep
HWCAP_HAS_ALTIVEC =
HWCAP_HAS_DFP =
HWCAP_HAS_HTM =
HWCAP_HAS_ISA_2_05 =
HWCAP_HAS_ISA_2_06 =
HWCAP_HAS_ISA_2_07 =
HWCAP_HAS_VSX =
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LDFLAGS =
LDFLAGS_MPI = -fpic -shared
LIBOBJS =
LIBS =
LIB_UBSAN =
LN_S = ln -s
LTLIBOBJS =
MAINT = #
MAKEINFO = ${SHELL} /root/03_day/valgrind-3.11.0/missing makeinfo
MKDIR_P = /bin/mkdir -p
MPI_CC = mpicc
OBJEXT = o
PACKAGE = valgrind
PACKAGE_BUGREPORT = valgrind-users@lists.sourceforge.net
PACKAGE_NAME = Valgrind
PACKAGE_STRING = Valgrind 3.11.0
PACKAGE_TARNAME = valgrind
PACKAGE_URL =
PACKAGE_VERSION = 3.11.0
PATH_SEPARATOR = :
PERL = /usr/bin/perl
PREFERRED_STACK_BOUNDARY_2 = -mpreferred-stack-boundary=2
RANLIB = ranlib
SED = /bin/sed
SET_MAKE =
SHELL = /bin/bash
STRIP =
VALT_LOAD_ADDRESS_PRI = 0x38000000
VALT_LOAD_ADDRESS_SEC = 0xUNSET
VERSION = 3.11.0
VGCONF_ARCH_PRI = x86
VGCONF_ARCH_SEC =
VGCONF_OS = linux
VGCONF_PLATFORM_PRI_CAPS = X86_LINUX
VGCONF_PLATFORM_SEC_CAPS =
VGCONF_PLATVARIANT = vanilla
VG_TMPDIR = /tmp
abs_builddir = /root/03_day/valgrind-3.11.0/cachegrind/tests/x86
abs_srcdir = /root/03_day/valgrind-3.11.0/cachegrind/tests/x86
abs_top_builddir = /root/03_day/valgrind-3.11.0
abs_top_srcdir = /root/03_day/valgrind-3.11.0
ac_ct_CC = gcc
ac_ct_CXX = g++
am__include = include
am__leading_dot = .
am__quote =
am__tar = $${TAR-tar} chof - "$$tardir"
am__untar = $${TAR-tar} xf -
bindir = ${exec_prefix}/bin
build = i686-pc-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = pc
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = i686-pc-linux-gnu
host_alias =
host_cpu = i686
host_os = linux-gnu
host_vendor = pc
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /root/03_day/valgrind-3.11.0/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P)
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../../../
top_builddir = ../../..
top_srcdir = ../../..
inplacedir = $(top_builddir)/.in_place
#----------------------------------------------------------------------------
# Flags
#----------------------------------------------------------------------------
# Baseline flags for all compilations. Aim here is to maximise
# performance and get whatever useful warnings we can out of gcc.
# -fno-builtin is important for defeating LLVM's idiom recognition
# that somehow causes VG_(memset) to get into infinite recursion.
AM_CFLAGS_BASE = -O2 -g -std=gnu99 -Wall -Wmissing-prototypes -Wshadow \
-Wpointer-arith -Wstrict-prototypes -Wmissing-declarations \
-Wcast-align -Wcast-qual -Wwrite-strings \
-Wempty-body -Wformat \
-Wformat-security -Wignored-qualifiers \
-Wmissing-parameter-type -Wold-style-declaration \
-fno-stack-protector \
-fno-strict-aliasing -fno-builtin $(am__append_1)
AM_CFLAGS_PSO_BASE = -O -g -fno-omit-frame-pointer -fno-strict-aliasing \
-fpic -fno-builtin -fno-ipa-icf
# These flags are used for building the preload shared objects (PSOs).
# The aim is to give reasonable performance but also to have good
# stack traces, since users often see stack traces extending
# into (and through) the preloads. Also, we must use any
# -mpreferred-stack-boundary flag to build the preload shared
# objects, since that risks misaligning the client's stack and
# results in segfaults like (eg) #324050.
#AM_CFLAGS_PSO_BASE = -dynamic \
# -O -g -fno-omit-frame-pointer -fno-strict-aliasing \
# -fpic -fPIC -fno-builtin -fno-ipa-icf
# Flags for specific targets.
#
# Nb: the AM_CPPFLAGS_* values are suitable for building tools and auxprogs.
# For building the core, coregrind/Makefile.am files add some extra things.
AM_CPPFLAGS_X86_LINUX = \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/VEX/pub \
-I$(top_builddir)/VEX/pub \
-DVGA_x86=1 \
-DVGO_linux=1 \
-DVGP_x86_linux=1 \
-DVGPV_x86_linux_vanilla=1
#AM_CPPFLAGS_ = \
# -I$(top_srcdir) \
# -I$(top_srcdir)/include \
# -I$(top_srcdir)/VEX/pub \
# -I$(top_builddir)/VEX/pub \
# -DVGA_=1 \
# -DVGO_linux=1 \
# -DVGP__linux=1 \
# -DVGPV__linux_vanilla=1
AM_FLAG_M3264_X86_LINUX = -m32
AM_CFLAGS_X86_LINUX = -m32 -mpreferred-stack-boundary=2 \
$(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_X86_LINUX = -m32 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_X86_LINUX = -m32 -g
AM_FLAG_M3264_AMD64_LINUX = -m64
AM_CFLAGS_AMD64_LINUX = -m64 \
$(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_AMD64_LINUX = -m64 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_AMD64_LINUX = -m64 -g
AM_FLAG_M3264_PPC32_LINUX = -m32
AM_CFLAGS_PPC32_LINUX = -m32 $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_PPC32_LINUX = -m32 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_PPC32_LINUX = -m32 -g
AM_FLAG_M3264_PPC64BE_LINUX = -m64
AM_CFLAGS_PPC64BE_LINUX = -m64 $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_PPC64BE_LINUX = -m64 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_PPC64BE_LINUX = -m64 -g
AM_FLAG_M3264_PPC64LE_LINUX = -m64
AM_CFLAGS_PPC64LE_LINUX = -m64 $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_PPC64LE_LINUX = -m64 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_PPC64LE_LINUX = -m64 -g
AM_FLAG_M3264_ARM_LINUX = -m32
AM_CFLAGS_ARM_LINUX = -m32 \
$(AM_CFLAGS_BASE) -marm -mcpu=cortex-a8
AM_CFLAGS_PSO_ARM_LINUX = -m32 $(AM_CFLAGS_BASE) \
-marm -mcpu=cortex-a8 $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_ARM_LINUX = -m32 \
-marm -mcpu=cortex-a8 -g
AM_FLAG_M3264_ARM64_LINUX = -m64
AM_CFLAGS_ARM64_LINUX = -m64 $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_ARM64_LINUX = -m64 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_ARM64_LINUX = -m64 -g
AM_FLAG_M3264_X86_DARWIN = -arch i386
AM_CFLAGS_X86_DARWIN = $(WERROR) -arch i386 $(AM_CFLAGS_BASE) \
-mmacosx-version-min=10.5 \
-fno-stack-protector -fno-pic -fno-PIC
AM_CFLAGS_PSO_X86_DARWIN = $(AM_CFLAGS_X86_DARWIN) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_X86_DARWIN = -arch i386 -g
AM_FLAG_M3264_AMD64_DARWIN = -arch x86_64
AM_CFLAGS_AMD64_DARWIN = $(WERROR) -arch x86_64 $(AM_CFLAGS_BASE) \
-mmacosx-version-min=10.5 -fno-stack-protector
AM_CFLAGS_PSO_AMD64_DARWIN = $(AM_CFLAGS_AMD64_DARWIN) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_AMD64_DARWIN = -arch x86_64 -g
AM_FLAG_M3264_S390X_LINUX = -m64
AM_CFLAGS_S390X_LINUX = -m64 $(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_S390X_LINUX = -m64 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_S390X_LINUX = -m64 -g -mzarch -march=z900
AM_FLAG_M3264_MIPS32_LINUX = -m32
AM_CFLAGS_MIPS32_LINUX = -m32 $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_MIPS32_LINUX = -m32 $(AM_CFLAGS_BASE) \
$(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_MIPS32_LINUX = -m32 -g
AM_FLAG_M3264_MIPS64_LINUX = -m64
AM_CFLAGS_MIPS64_LINUX = -m64 $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_MIPS64_LINUX = -m64 $(AM_CFLAGS_BASE) \
$(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_MIPS64_LINUX = -m64 -g
AM_CFLAGS_TILEGX_LINUX = -m64 $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_TILEGX_LINUX = -m64 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_FLAG_M3264_X86_SOLARIS = -m32
AM_CFLAGS_X86_SOLARIS = -m32 -mpreferred-stack-boundary=2 \
$(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_X86_SOLARIS = -m32 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_X86_SOLARIS = -m32 -g -D_ASM
AM_FLAG_M3264_AMD64_SOLARIS = -m64
AM_CFLAGS_AMD64_SOLARIS = -m64 \
$(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_AMD64_SOLARIS = -m64 $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_AMD64_SOLARIS = -m64 -g -D_ASM
# Flags for the primary target. These must be used to build the
# regtests and performance tests. In fact, these must be used to
# build anything which is built only once on a dual-arch build.
#
AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_X86_LINUX)
AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_X86_LINUX)
AM_CFLAGS_PRI = $(AM_CFLAGS_X86_LINUX)
AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_X86_LINUX)
AM_FLAG_M3264_SEC =
#AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_)
# Baseline link flags for making vgpreload shared objects.
#
PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared \
-Wl,-z,interpose,-z,initfirst $(am__append_3)
PRELOAD_LDFLAGS_COMMON_DARWIN = -dynamic -dynamiclib -all_load
PRELOAD_LDFLAGS_COMMON_SOLARIS = -nodefaultlibs -shared \
-Wl,-z,interpose,-z,initfirst $(am__append_2)
PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m32
PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m64
PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m32
PRELOAD_LDFLAGS_PPC64BE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m64
PRELOAD_LDFLAGS_PPC64LE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m64
PRELOAD_LDFLAGS_ARM_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m32
PRELOAD_LDFLAGS_ARM64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m64
PRELOAD_LDFLAGS_X86_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386
PRELOAD_LDFLAGS_AMD64_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch x86_64
PRELOAD_LDFLAGS_S390X_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m64
PRELOAD_LDFLAGS_MIPS32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m32
PRELOAD_LDFLAGS_MIPS64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m64
PRELOAD_LDFLAGS_TILEGX_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) -m64
PRELOAD_LDFLAGS_X86_SOLARIS = $(PRELOAD_LDFLAGS_COMMON_SOLARIS) -m32
PRELOAD_LDFLAGS_AMD64_SOLARIS = $(PRELOAD_LDFLAGS_COMMON_SOLARIS) -m64
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include \
-I$(top_srcdir)/coregrind -I$(top_builddir)/include \
-I$(top_srcdir)/VEX/pub -I$(top_builddir)/VEX/pub \
-DVGA_x86=1 -DVGO_linux=1 \
-DVGP_x86_linux=1 \
-DVGPV_x86_linux_vanilla=1 \
$(am__append_4)
# Nb: Tools need to augment these flags with an arch-selection option, such
# as $(AM_FLAG_M3264_PRI).
AM_CFLAGS = -Winline -Wall -Wshadow -Wno-long-long -g \
-fno-stack-protector $(am__append_5) $(am__append_6) \
-m32 $(FLAG_MMMX) $(FLAG_MSSE)
AM_CXXFLAGS = -Winline -Wall -Wshadow -Wno-long-long -g \
-fno-stack-protector $(am__append_7) -m32 \
$(FLAG_MMMX) $(FLAG_MSSE)
# Include AM_CPPFLAGS in AM_CCASFLAGS to allow for older versions of
# automake; see comments in Makefile.all.am for more detail.
AM_CCASFLAGS = $(AM_CPPFLAGS) -m32
#noinst_DSYMS = $(check_PROGRAMS)
dist_noinst_SCRIPTS = filter_stderr
EXTRA_DIST = \
fpu-28-108.vgtest fpu-28-108.stderr.exp
fpu_28_108_SOURCES = fpu-28-108.S
all: all-am
.SUFFIXES:
.SUFFIXES: .S .o .obj
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(top_srcdir)/Makefile.tool-tests.am $(top_srcdir)/Makefile.all.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign cachegrind/tests/x86/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign cachegrind/tests/x86/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_srcdir)/Makefile.tool-tests.am $(top_srcdir)/Makefile.all.am:
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: # $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-checkPROGRAMS:
-test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
fpu-28-108$(EXEEXT): $(fpu_28_108_OBJECTS) $(fpu_28_108_DEPENDENCIES) $(EXTRA_fpu_28_108_DEPENDENCIES)
@rm -f fpu-28-108$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(fpu_28_108_OBJECTS) $(fpu_28_108_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/fpu-28-108.Po
.S.o:
$(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
$(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
$(am__mv) $$depbase.Tpo $$depbase.Po
# $(AM_V_CPPAS)source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) \
# $(AM_V_CPPAS_no)$(CPPASCOMPILE) -c -o $@ $<
.S.obj:
$(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
$(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
$(am__mv) $$depbase.Tpo $$depbase.Po
# $(AM_V_CPPAS)source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) \
# $(AM_V_CPPAS_no)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-local
check: check-am
all-am: Makefile $(SCRIPTS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-local mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \
clean-checkPROGRAMS clean-generic clean-local cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
# This used to be required when Vex had a handwritten Makefile. It
# shouldn't be needed any more, though.
#----------------------------------------------------------------------------
# noinst_PROGRAMS and noinst_DSYMS targets
#----------------------------------------------------------------------------
# On Darwin, for a program 'p', the DWARF debug info is stored in the
# directory 'p.dSYM'. This must be generated after the executable is
# created, with 'dsymutil p'. We could redefine LINK with a script that
# executes 'dsymutil' after linking, but that's a pain. Instead we use this
# hook so that every time "make check" is run, we subsequently invoke
# 'dsymutil' on all the executables that lack a .dSYM directory, or that are
# newer than their corresponding .dSYM directory.
build-noinst_DSYMS: $(noinst_DSYMS)
for f in $(noinst_DSYMS); do \
if [ ! -e $$f.dSYM -o $$f -nt $$f.dSYM ] ; then \
echo "dsymutil $$f"; \
dsymutil $$f; \
fi; \
done
# This is used by coregrind/Makefile.am and Makefile.tool.am for doing
# "in-place" installs. It copies $(noinst_PROGRAMS) into $inplacedir.
# It needs to be depended on by an 'all-local' rule.
inplace-noinst_PROGRAMS: $(noinst_PROGRAMS)
mkdir -p $(inplacedir); \
for f in $(noinst_PROGRAMS) ; do \
rm -f $(inplacedir)/$$f; \
ln -f -s ../$(subdir)/$$f $(inplacedir); \
done
# Similar to inplace-noinst_PROGRAMS
inplace-noinst_DSYMS: build-noinst_DSYMS
mkdir -p $(inplacedir); \
for f in $(noinst_DSYMS); do \
rm -f $(inplacedir)/$$f.dSYM; \
ln -f -s ../$(subdir)/$$f.dSYM $(inplacedir); \
done
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
# "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/.
# It needs to be depended on by an 'install-exec-local' rule.
install-noinst_PROGRAMS: $(noinst_PROGRAMS)
$(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
for f in $(noinst_PROGRAMS); do \
$(INSTALL_PROGRAM) $$f $(DESTDIR)$(pkglibdir); \
done
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
# "make uninstall". It removes $(noinst_PROGRAMS) from $prefix/lib/valgrind/.
# It needs to be depended on by an 'uninstall-local' rule.
uninstall-noinst_PROGRAMS:
for f in $(noinst_PROGRAMS); do \
rm -f $(DESTDIR)$(pkglibdir)/$$f; \
done
# Similar to install-noinst_PROGRAMS.
# Nb: we don't use $(INSTALL_PROGRAM) here because it doesn't work with
# directories. XXX: not sure whether the resulting permissions will be
# correct when using 'cp -R'...
install-noinst_DSYMS: build-noinst_DSYMS
$(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
for f in $(noinst_DSYMS); do \
cp -R $$f.dSYM $(DESTDIR)$(pkglibdir); \
done
# Similar to uninstall-noinst_PROGRAMS.
uninstall-noinst_DSYMS:
for f in $(noinst_DSYMS); do \
rm -f $(DESTDIR)$(pkglibdir)/$$f.dSYM; \
done
# This needs to be depended on by a 'clean-local' rule.
clean-noinst_DSYMS:
for f in $(noinst_DSYMS); do \
rm -rf $$f.dSYM; \
done
check-local: build-noinst_DSYMS
clean-local: clean-noinst_DSYMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
@@ -0,0 +1,17 @@
include $(top_srcdir)/Makefile.tool-tests.am
dist_noinst_SCRIPTS = filter_stderr
EXTRA_DIST = \
fpu-28-108.vgtest fpu-28-108.stderr.exp
check_PROGRAMS = \
fpu-28-108
AM_CFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)
AM_CXXFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)
AM_CCASFLAGS += @FLAG_M32@
fpu_28_108_SOURCES = fpu-28-108.S
@@ -0,0 +1,915 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# This file is used for tool tests, and also in perf/Makefile.am.
# This file should be included (directly or indirectly) by every
# Makefile.am that builds programs. And also the top-level Makefile.am.
#----------------------------------------------------------------------------
# Global stuff
#----------------------------------------------------------------------------
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(top_srcdir)/Makefile.tool-tests.am \
$(top_srcdir)/Makefile.all.am $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(dist_noinst_SCRIPTS) \
$(top_srcdir)/depcomp
@COMPILER_IS_CLANG_TRUE@am__append_1 = -Wno-cast-align -Wno-self-assign \
@COMPILER_IS_CLANG_TRUE@ -Wno-tautological-compare
@SOLARIS_XPG_SYMBOLS_PRESENT_TRUE@am__append_2 = -Wl,-M,$(top_srcdir)/solaris/vgpreload-solaris.mapfile
# The Android toolchain includes all kinds of stdlib helpers present in
# bionic which is bad because we are not linking with it and the Android
# linker will panic.
@VGCONF_PLATVARIANT_IS_ANDROID_TRUE@am__append_3 = -nostdlib
@VGCONF_HAVE_PLATFORM_SEC_TRUE@am__append_4 = -DVGA_SEC_@VGCONF_ARCH_SEC@=1 \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -DVGP_SEC_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1
# Make sure that all test programs have threaded errno.
@VGCONF_OS_IS_SOLARIS_TRUE@am__append_5 = -D_REENTRANT
@COMPILER_IS_CLANG_TRUE@am__append_6 = -Wno-format-extra-args \
@COMPILER_IS_CLANG_TRUE@ -Wno-literal-range \
@COMPILER_IS_CLANG_TRUE@ -Wno-tautological-constant-out-of-range-compare \
@COMPILER_IS_CLANG_TRUE@ -Wno-self-assign -Wno-string-plus-int \
@COMPILER_IS_CLANG_TRUE@ -Wno-uninitialized -Wno-unused-value # \
@COMPILER_IS_CLANG_TRUE@ clang 3.0.0
@COMPILER_IS_CLANG_TRUE@am__append_7 = -Wno-unused-private-field # drd/tests/tsan_unittest.cpp
check_PROGRAMS = fpu-28-108$(EXEEXT)
subdir = cachegrind/tests/x86
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am_fpu_28_108_OBJECTS = fpu-28-108.$(OBJEXT)
fpu_28_108_OBJECTS = $(am_fpu_28_108_OBJECTS)
fpu_28_108_LDADD = $(LDADD)
SCRIPTS = $(dist_noinst_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
am__v_CPPAS_0 = @echo " CPPAS " $@;
am__v_CPPAS_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(fpu_28_108_SOURCES)
DIST_SOURCES = $(fpu_28_108_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BOOST_CFLAGS = @BOOST_CFLAGS@
BOOST_LIBS = @BOOST_LIBS@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CFLAGS_MPI = @CFLAGS_MPI@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFAULT_SUPP = @DEFAULT_SUPP@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIFF = @DIFF@
DIS_PATH = @DIS_PATH@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FLAG_FNO_IPA_ICF = @FLAG_FNO_IPA_ICF@
FLAG_FNO_STACK_PROTECTOR = @FLAG_FNO_STACK_PROTECTOR@
FLAG_FSANITIZE = @FLAG_FSANITIZE@
FLAG_M32 = @FLAG_M32@
FLAG_M64 = @FLAG_M64@
FLAG_MIPS32 = @FLAG_MIPS32@
FLAG_MIPS64 = @FLAG_MIPS64@
FLAG_MLONG_DOUBLE_128 = @FLAG_MLONG_DOUBLE_128@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
FLAG_OCTEON = @FLAG_OCTEON@
FLAG_OCTEON2 = @FLAG_OCTEON2@
FLAG_T_TEXT = @FLAG_T_TEXT@
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_CAST_ALIGN = @FLAG_W_CAST_ALIGN@
FLAG_W_CAST_QUAL = @FLAG_W_CAST_QUAL@
FLAG_W_EMPTY_BODY = @FLAG_W_EMPTY_BODY@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_FORMAT = @FLAG_W_FORMAT@
FLAG_W_FORMAT_SECURITY = @FLAG_W_FORMAT_SECURITY@
FLAG_W_FORMAT_SIGNEDNESS = @FLAG_W_FORMAT_SIGNEDNESS@
FLAG_W_IGNORED_QUALIFIERS = @FLAG_W_IGNORED_QUALIFIERS@
FLAG_W_MISSING_PARAMETER_TYPE = @FLAG_W_MISSING_PARAMETER_TYPE@
FLAG_W_NO_INFINITE_RECURSION = @FLAG_W_NO_INFINITE_RECURSION@
FLAG_W_NO_MEMSET_TRANSPOSED_ARGS = @FLAG_W_NO_MEMSET_TRANSPOSED_ARGS@
FLAG_W_NO_MISMATCHED_NEW_DELETE = @FLAG_W_NO_MISMATCHED_NEW_DELETE@
FLAG_W_NO_NONNULL = @FLAG_W_NO_NONNULL@
FLAG_W_NO_OVERFLOW = @FLAG_W_NO_OVERFLOW@
FLAG_W_NO_POINTER_SIGN = @FLAG_W_NO_POINTER_SIGN@
FLAG_W_NO_STATIC_LOCAL_IN_INLINE = @FLAG_W_NO_STATIC_LOCAL_IN_INLINE@
FLAG_W_NO_UNINITIALIZED = @FLAG_W_NO_UNINITIALIZED@
FLAG_W_NO_UNUSED_FUNCTION = @FLAG_W_NO_UNUSED_FUNCTION@
FLAG_W_OLD_STYLE_DECLARATION = @FLAG_W_OLD_STYLE_DECLARATION@
FLAG_W_WRITE_STRINGS = @FLAG_W_WRITE_STRINGS@
GDB = @GDB@
GLIBC_VERSION = @GLIBC_VERSION@
GREP = @GREP@
HWCAP_HAS_ALTIVEC = @HWCAP_HAS_ALTIVEC@
HWCAP_HAS_DFP = @HWCAP_HAS_DFP@
HWCAP_HAS_HTM = @HWCAP_HAS_HTM@
HWCAP_HAS_ISA_2_05 = @HWCAP_HAS_ISA_2_05@
HWCAP_HAS_ISA_2_06 = @HWCAP_HAS_ISA_2_06@
HWCAP_HAS_ISA_2_07 = @HWCAP_HAS_ISA_2_07@
HWCAP_HAS_VSX = @HWCAP_HAS_VSX@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LDFLAGS_MPI = @LDFLAGS_MPI@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIB_UBSAN = @LIB_UBSAN@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MPI_CC = @MPI_CC@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PREFERRED_STACK_BOUNDARY_2 = @PREFERRED_STACK_BOUNDARY_2@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VALT_LOAD_ADDRESS_PRI = @VALT_LOAD_ADDRESS_PRI@
VALT_LOAD_ADDRESS_SEC = @VALT_LOAD_ADDRESS_SEC@
VERSION = @VERSION@
VGCONF_ARCH_PRI = @VGCONF_ARCH_PRI@
VGCONF_ARCH_SEC = @VGCONF_ARCH_SEC@
VGCONF_OS = @VGCONF_OS@
VGCONF_PLATFORM_PRI_CAPS = @VGCONF_PLATFORM_PRI_CAPS@
VGCONF_PLATFORM_SEC_CAPS = @VGCONF_PLATFORM_SEC_CAPS@
VGCONF_PLATVARIANT = @VGCONF_PLATVARIANT@
VG_TMPDIR = @VG_TMPDIR@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
inplacedir = $(top_builddir)/.in_place
#----------------------------------------------------------------------------
# Flags
#----------------------------------------------------------------------------
# Baseline flags for all compilations. Aim here is to maximise
# performance and get whatever useful warnings we can out of gcc.
# -fno-builtin is important for defeating LLVM's idiom recognition
# that somehow causes VG_(memset) to get into infinite recursion.
AM_CFLAGS_BASE = -O2 -g -std=gnu99 -Wall -Wmissing-prototypes -Wshadow \
-Wpointer-arith -Wstrict-prototypes -Wmissing-declarations \
@FLAG_W_CAST_ALIGN@ @FLAG_W_CAST_QUAL@ @FLAG_W_WRITE_STRINGS@ \
@FLAG_W_EMPTY_BODY@ @FLAG_W_FORMAT@ @FLAG_W_FORMAT_SIGNEDNESS@ \
@FLAG_W_FORMAT_SECURITY@ @FLAG_W_IGNORED_QUALIFIERS@ \
@FLAG_W_MISSING_PARAMETER_TYPE@ @FLAG_W_OLD_STYLE_DECLARATION@ \
@FLAG_FNO_STACK_PROTECTOR@ @FLAG_FSANITIZE@ \
-fno-strict-aliasing -fno-builtin $(am__append_1)
@VGCONF_OS_IS_DARWIN_FALSE@AM_CFLAGS_PSO_BASE = -O -g -fno-omit-frame-pointer -fno-strict-aliasing \
@VGCONF_OS_IS_DARWIN_FALSE@ -fpic -fno-builtin @FLAG_FNO_IPA_ICF@
# These flags are used for building the preload shared objects (PSOs).
# The aim is to give reasonable performance but also to have good
# stack traces, since users often see stack traces extending
# into (and through) the preloads. Also, we must use any
# -mpreferred-stack-boundary flag to build the preload shared
# objects, since that risks misaligning the client's stack and
# results in segfaults like (eg) #324050.
@VGCONF_OS_IS_DARWIN_TRUE@AM_CFLAGS_PSO_BASE = -dynamic \
@VGCONF_OS_IS_DARWIN_TRUE@ -O -g -fno-omit-frame-pointer -fno-strict-aliasing \
@VGCONF_OS_IS_DARWIN_TRUE@ -fpic -fPIC -fno-builtin @FLAG_FNO_IPA_ICF@
# Flags for specific targets.
#
# Nb: the AM_CPPFLAGS_* values are suitable for building tools and auxprogs.
# For building the core, coregrind/Makefile.am files add some extra things.
AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@ = \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/VEX/pub \
-I$(top_builddir)/VEX/pub \
-DVGA_@VGCONF_ARCH_PRI@=1 \
-DVGO_@VGCONF_OS@=1 \
-DVGP_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1 \
-DVGPV_@VGCONF_ARCH_PRI@_@VGCONF_OS@_@VGCONF_PLATVARIANT@=1
@VGCONF_HAVE_PLATFORM_SEC_TRUE@AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@ = \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -I$(top_srcdir) \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -I$(top_srcdir)/include \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -I$(top_srcdir)/VEX/pub \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -I$(top_builddir)/VEX/pub \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -DVGA_@VGCONF_ARCH_SEC@=1 \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -DVGO_@VGCONF_OS@=1 \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -DVGP_@VGCONF_ARCH_SEC@_@VGCONF_OS@=1 \
@VGCONF_HAVE_PLATFORM_SEC_TRUE@ -DVGPV_@VGCONF_ARCH_SEC@_@VGCONF_OS@_@VGCONF_PLATVARIANT@=1
AM_FLAG_M3264_X86_LINUX = @FLAG_M32@
AM_CFLAGS_X86_LINUX = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY_2@ \
$(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_X86_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_X86_LINUX = @FLAG_M32@ -g
AM_FLAG_M3264_AMD64_LINUX = @FLAG_M64@
AM_CFLAGS_AMD64_LINUX = @FLAG_M64@ \
$(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_AMD64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_AMD64_LINUX = @FLAG_M64@ -g
AM_FLAG_M3264_PPC32_LINUX = @FLAG_M32@
AM_CFLAGS_PPC32_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_PPC32_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_PPC32_LINUX = @FLAG_M32@ -g
AM_FLAG_M3264_PPC64BE_LINUX = @FLAG_M64@
AM_CFLAGS_PPC64BE_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_PPC64BE_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_PPC64BE_LINUX = @FLAG_M64@ -g
AM_FLAG_M3264_PPC64LE_LINUX = @FLAG_M64@
AM_CFLAGS_PPC64LE_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_PPC64LE_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_PPC64LE_LINUX = @FLAG_M64@ -g
AM_FLAG_M3264_ARM_LINUX = @FLAG_M32@
AM_CFLAGS_ARM_LINUX = @FLAG_M32@ \
$(AM_CFLAGS_BASE) -marm -mcpu=cortex-a8
AM_CFLAGS_PSO_ARM_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) \
-marm -mcpu=cortex-a8 $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_ARM_LINUX = @FLAG_M32@ \
-marm -mcpu=cortex-a8 -g
AM_FLAG_M3264_ARM64_LINUX = @FLAG_M64@
AM_CFLAGS_ARM64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_ARM64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_ARM64_LINUX = @FLAG_M64@ -g
AM_FLAG_M3264_X86_DARWIN = -arch i386
AM_CFLAGS_X86_DARWIN = $(WERROR) -arch i386 $(AM_CFLAGS_BASE) \
-mmacosx-version-min=10.5 \
-fno-stack-protector -fno-pic -fno-PIC
AM_CFLAGS_PSO_X86_DARWIN = $(AM_CFLAGS_X86_DARWIN) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_X86_DARWIN = -arch i386 -g
AM_FLAG_M3264_AMD64_DARWIN = -arch x86_64
AM_CFLAGS_AMD64_DARWIN = $(WERROR) -arch x86_64 $(AM_CFLAGS_BASE) \
-mmacosx-version-min=10.5 -fno-stack-protector
AM_CFLAGS_PSO_AMD64_DARWIN = $(AM_CFLAGS_AMD64_DARWIN) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_AMD64_DARWIN = -arch x86_64 -g
AM_FLAG_M3264_S390X_LINUX = @FLAG_M64@
AM_CFLAGS_S390X_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_S390X_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_S390X_LINUX = @FLAG_M64@ -g -mzarch -march=z900
AM_FLAG_M3264_MIPS32_LINUX = @FLAG_M32@
AM_CFLAGS_MIPS32_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) @FLAG_MIPS32@
AM_CFLAGS_PSO_MIPS32_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) @FLAG_MIPS32@ \
$(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_MIPS32_LINUX = @FLAG_M32@ -g @FLAG_MIPS32@
AM_FLAG_M3264_MIPS64_LINUX = @FLAG_M64@
AM_CFLAGS_MIPS64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) @FLAG_MIPS64@
AM_CFLAGS_PSO_MIPS64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) @FLAG_MIPS64@ \
$(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_MIPS64_LINUX = @FLAG_M64@ -g @FLAG_MIPS64@
AM_CFLAGS_TILEGX_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE)
AM_CFLAGS_PSO_TILEGX_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_FLAG_M3264_X86_SOLARIS = @FLAG_M32@
AM_CFLAGS_X86_SOLARIS = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY_2@ \
$(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_X86_SOLARIS = @FLAG_M32@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_X86_SOLARIS = @FLAG_M32@ -g -D_ASM
AM_FLAG_M3264_AMD64_SOLARIS = @FLAG_M64@
AM_CFLAGS_AMD64_SOLARIS = @FLAG_M64@ \
$(AM_CFLAGS_BASE) -fomit-frame-pointer
AM_CFLAGS_PSO_AMD64_SOLARIS = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_AMD64_SOLARIS = @FLAG_M64@ -g -D_ASM
# Flags for the primary target. These must be used to build the
# regtests and performance tests. In fact, these must be used to
# build anything which is built only once on a dual-arch build.
#
AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_@VGCONF_PLATFORM_PRI_CAPS@)
AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
AM_CFLAGS_PRI = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
@VGCONF_HAVE_PLATFORM_SEC_FALSE@AM_FLAG_M3264_SEC =
@VGCONF_HAVE_PLATFORM_SEC_TRUE@AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_@VGCONF_PLATFORM_SEC_CAPS@)
# Baseline link flags for making vgpreload shared objects.
#
PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared \
-Wl,-z,interpose,-z,initfirst $(am__append_3)
PRELOAD_LDFLAGS_COMMON_DARWIN = -dynamic -dynamiclib -all_load
PRELOAD_LDFLAGS_COMMON_SOLARIS = -nodefaultlibs -shared \
-Wl,-z,interpose,-z,initfirst $(am__append_2)
PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
PRELOAD_LDFLAGS_PPC64BE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
PRELOAD_LDFLAGS_PPC64LE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
PRELOAD_LDFLAGS_ARM_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
PRELOAD_LDFLAGS_ARM64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
PRELOAD_LDFLAGS_X86_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386
PRELOAD_LDFLAGS_AMD64_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch x86_64
PRELOAD_LDFLAGS_S390X_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
PRELOAD_LDFLAGS_MIPS32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
PRELOAD_LDFLAGS_MIPS64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
PRELOAD_LDFLAGS_TILEGX_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
PRELOAD_LDFLAGS_X86_SOLARIS = $(PRELOAD_LDFLAGS_COMMON_SOLARIS) @FLAG_M32@
PRELOAD_LDFLAGS_AMD64_SOLARIS = $(PRELOAD_LDFLAGS_COMMON_SOLARIS) @FLAG_M64@
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include \
-I$(top_srcdir)/coregrind -I$(top_builddir)/include \
-I$(top_srcdir)/VEX/pub -I$(top_builddir)/VEX/pub \
-DVGA_@VGCONF_ARCH_PRI@=1 -DVGO_@VGCONF_OS@=1 \
-DVGP_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1 \
-DVGPV_@VGCONF_ARCH_PRI@_@VGCONF_OS@_@VGCONF_PLATVARIANT@=1 \
$(am__append_4)
# Nb: Tools need to augment these flags with an arch-selection option, such
# as $(AM_FLAG_M3264_PRI).
AM_CFLAGS = -Winline -Wall -Wshadow -Wno-long-long -g \
@FLAG_FNO_STACK_PROTECTOR@ $(am__append_5) $(am__append_6) \
@FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)
AM_CXXFLAGS = -Winline -Wall -Wshadow -Wno-long-long -g \
@FLAG_FNO_STACK_PROTECTOR@ $(am__append_7) @FLAG_M32@ \
$(FLAG_MMMX) $(FLAG_MSSE)
# Include AM_CPPFLAGS in AM_CCASFLAGS to allow for older versions of
# automake; see comments in Makefile.all.am for more detail.
AM_CCASFLAGS = $(AM_CPPFLAGS) @FLAG_M32@
@VGCONF_OS_IS_DARWIN_TRUE@noinst_DSYMS = $(check_PROGRAMS)
dist_noinst_SCRIPTS = filter_stderr
EXTRA_DIST = \
fpu-28-108.vgtest fpu-28-108.stderr.exp
fpu_28_108_SOURCES = fpu-28-108.S
all: all-am
.SUFFIXES:
.SUFFIXES: .S .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.tool-tests.am $(top_srcdir)/Makefile.all.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign cachegrind/tests/x86/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign cachegrind/tests/x86/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_srcdir)/Makefile.tool-tests.am $(top_srcdir)/Makefile.all.am:
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-checkPROGRAMS:
-test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
fpu-28-108$(EXEEXT): $(fpu_28_108_OBJECTS) $(fpu_28_108_DEPENDENCIES) $(EXTRA_fpu_28_108_DEPENDENCIES)
@rm -f fpu-28-108$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(fpu_28_108_OBJECTS) $(fpu_28_108_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpu-28-108.Po@am__quote@
.S.o:
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<
.S.obj:
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-local
check: check-am
all-am: Makefile $(SCRIPTS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-local mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \
clean-checkPROGRAMS clean-generic clean-local cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
# This used to be required when Vex had a handwritten Makefile. It
# shouldn't be needed any more, though.
#----------------------------------------------------------------------------
# noinst_PROGRAMS and noinst_DSYMS targets
#----------------------------------------------------------------------------
# On Darwin, for a program 'p', the DWARF debug info is stored in the
# directory 'p.dSYM'. This must be generated after the executable is
# created, with 'dsymutil p'. We could redefine LINK with a script that
# executes 'dsymutil' after linking, but that's a pain. Instead we use this
# hook so that every time "make check" is run, we subsequently invoke
# 'dsymutil' on all the executables that lack a .dSYM directory, or that are
# newer than their corresponding .dSYM directory.
build-noinst_DSYMS: $(noinst_DSYMS)
for f in $(noinst_DSYMS); do \
if [ ! -e $$f.dSYM -o $$f -nt $$f.dSYM ] ; then \
echo "dsymutil $$f"; \
dsymutil $$f; \
fi; \
done
# This is used by coregrind/Makefile.am and Makefile.tool.am for doing
# "in-place" installs. It copies $(noinst_PROGRAMS) into $inplacedir.
# It needs to be depended on by an 'all-local' rule.
inplace-noinst_PROGRAMS: $(noinst_PROGRAMS)
mkdir -p $(inplacedir); \
for f in $(noinst_PROGRAMS) ; do \
rm -f $(inplacedir)/$$f; \
ln -f -s ../$(subdir)/$$f $(inplacedir); \
done
# Similar to inplace-noinst_PROGRAMS
inplace-noinst_DSYMS: build-noinst_DSYMS
mkdir -p $(inplacedir); \
for f in $(noinst_DSYMS); do \
rm -f $(inplacedir)/$$f.dSYM; \
ln -f -s ../$(subdir)/$$f.dSYM $(inplacedir); \
done
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
# "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/.
# It needs to be depended on by an 'install-exec-local' rule.
install-noinst_PROGRAMS: $(noinst_PROGRAMS)
$(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
for f in $(noinst_PROGRAMS); do \
$(INSTALL_PROGRAM) $$f $(DESTDIR)$(pkglibdir); \
done
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
# "make uninstall". It removes $(noinst_PROGRAMS) from $prefix/lib/valgrind/.
# It needs to be depended on by an 'uninstall-local' rule.
uninstall-noinst_PROGRAMS:
for f in $(noinst_PROGRAMS); do \
rm -f $(DESTDIR)$(pkglibdir)/$$f; \
done
# Similar to install-noinst_PROGRAMS.
# Nb: we don't use $(INSTALL_PROGRAM) here because it doesn't work with
# directories. XXX: not sure whether the resulting permissions will be
# correct when using 'cp -R'...
install-noinst_DSYMS: build-noinst_DSYMS
$(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
for f in $(noinst_DSYMS); do \
cp -R $$f.dSYM $(DESTDIR)$(pkglibdir); \
done
# Similar to uninstall-noinst_PROGRAMS.
uninstall-noinst_DSYMS:
for f in $(noinst_DSYMS); do \
rm -f $(DESTDIR)$(pkglibdir)/$$f.dSYM; \
done
# This needs to be depended on by a 'clean-local' rule.
clean-noinst_DSYMS:
for f in $(noinst_DSYMS); do \
rm -rf $$f.dSYM; \
done
check-local: build-noinst_DSYMS
clean-local: clean-noinst_DSYMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
@@ -0,0 +1,4 @@
#! /bin/sh
# Use the generic Cachegrind stderr filter
../filter_stderr
@@ -0,0 +1,26 @@
/* Test 28 and 108 byte loads and stores. (Just make sure program
runs without any assertion failures from V.) */
/* Useful listing:
gcc -o tests/fpu_28_108 tests/fpu_28_108.S -Wa,-a */
#include "tests/asm.h"
.data
fooble:
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
bar:
.text
.globl VG_SYM_ASM(main)
VG_SYM_ASM(main):
fstsw fooble
fsave fooble
frstor fooble
fstenv fooble
fldenv fooble
movl $0, %eax
ret
@@ -0,0 +1,17 @@
I refs:
I1 misses:
LLi misses:
I1 miss rate:
LLi miss rate:
D refs:
D1 misses:
LLd misses:
D1 miss rate:
LLd miss rate:
LL refs:
LL misses:
LL miss rate:
@@ -0,0 +1,2 @@
prog: fpu-28-108
cleanup: rm cachegrind.out.*