summaryrefslogtreecommitdiff
path: root/massif
diff options
context:
space:
mode:
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-09-27 19:20:21 +0000
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-09-27 19:20:21 +0000
commit45f4e7c91119c7d01a59f5e827c67841632c9314 (patch)
treecf3699fede5e2136f3141b32b7d0324a39aa726d /massif
parent1df54d2464f181a989638ef4307152482c2ad395 (diff)
This commit merges in changes from branches/ASPACEM (specifically,
changes from r4341 through r4787 inclusive). That branch is now dead. Please do not commit anything else to it. For the most part the merge was not troublesome. The main areas of uncertainty are: - build system: I had to import by hand Makefile.core-AM_CPPFLAGS.am and include it in a couple of places. Building etc seems to still work, but I haven't tried building the documentation. - syscall wrappers: Following analysis by Greg & Nick, a whole lot of stuff was moved from -generic to -linux after the branch was created. I think that is satisfactorily glued back together now. - Regtests: although this appears to work, no .out files appear, which is strange, and makes it hard to diagnose regtest failures. In particular memcheck/tests/x86/scalar.stderr.exp remains in a conflicted state. - amd64 is broken (slightly), and ppc32 will be unbuildable. I'll attend to the former shortly. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4789 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'massif')
-rw-r--r--massif/Makefile.am18
-rw-r--r--massif/ms_main.c30
2 files changed, 29 insertions, 19 deletions
diff --git a/massif/Makefile.am b/massif/Makefile.am
index ffe94d91..f922a4c7 100644
--- a/massif/Makefile.am
+++ b/massif/Makefile.am
@@ -2,17 +2,17 @@ include $(top_srcdir)/Makefile.tool.am
SUBDIRS += hp2ps
-val_PROGRAMS = vgtool_massif.so vgpreload_massif.so
+val_PROGRAMS = massif vgpreload_massif.so
-vgtool_massif_so_SOURCES = ms_main.c
-vgtool_massif_so_LDFLAGS = -shared
-
-vgpreload_massif_so_SOURCES =
-vgpreload_massif_so_DEPENDENCIES = \
- $(LIBREPLACEMALLOC)
-vgpreload_massif_so_LDFLAGS = -shared -Wl,-z,interpose,-z,initfirst \
+vgpreload_massif_so_SOURCES =
+vgpreload_massif_so_DEPENDENCIES = $(LIBREPLACEMALLOC)
+vgpreload_massif_so_LDFLAGS = \
+ -shared -Wl,-z,interpose,-z,initfirst \
-Wl,--whole-archive \
$(LIBREPLACEMALLOC) \
-Wl,--no-whole-archive
-
+massif_SOURCES = ms_main.c
+massif_DEPENDENCIES = $(COREGRIND_LIBS)
+massif_LDADD = $(TOOL_LINKADD)
+massif_LDFLAGS = $(TOOL_LINKFLAGS)
diff --git a/massif/ms_main.c b/massif/ms_main.c
index 73c49d0d..cc4c1383 100644
--- a/massif/ms_main.c
+++ b/massif/ms_main.c
@@ -35,12 +35,12 @@
// structures below for more info on how things work.
#include "pub_tool_basics.h"
+#include "pub_tool_aspacemgr.h"
#include "pub_tool_debuginfo.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcassert.h"
#include "pub_tool_libcfile.h"
-#include "pub_tool_libcmman.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_libcproc.h"
#include "pub_tool_machine.h"
@@ -50,6 +50,7 @@
#include "pub_tool_replacemalloc.h"
#include "pub_tool_stacktrace.h"
#include "pub_tool_tooliface.h"
+#include "pub_tool_clientstate.h"
#include "valgrind.h" // For {MALLOC,FREE}LIKE_BLOCK
@@ -367,7 +368,10 @@ static void* perm_malloc(SizeT n_bytes)
#define SUPERBLOCK_SIZE (1 << 20) // 1 MB
if (hp + n_bytes > hp_lim) {
- hp = (Addr)VG_(get_memory_from_mmap)(SUPERBLOCK_SIZE, "perm_malloc");
+ hp = (Addr)VG_(am_shadow_alloc)(SUPERBLOCK_SIZE);
+ if (hp == 0)
+ VG_(out_of_memory_NORETURN)( "massif:perm_malloc",
+ SUPERBLOCK_SIZE);
hp_lim = hp + SUPERBLOCK_SIZE - 1;
}
@@ -1341,9 +1345,12 @@ static void write_hp_file(void)
// File header, including command line
SPRINTF(buf, "JOB \"");
- for (i = 0; i < VG_(client_argc); i++) {
- if (VG_(client_argv)[i])
- SPRINTF(buf, "%s ", VG_(client_argv)[i]);
+ if (VG_(args_the_exename)) {
+ SPRINTF(buf, "%s", VG_(args_the_exename));
+ }
+ for (i = 0; i < VG_(args_for_client).used; i++) {
+ if (VG_(args_for_client).strs[i])
+ SPRINTF(buf, " %s", VG_(args_for_client).strs[i]);
}
SPRINTF(buf, /*" (%d ms/sample)\"\n"*/ "\"\n"
"DATE \"\"\n"
@@ -1665,10 +1672,13 @@ write_text_file(ULong total_ST, ULong heap_ST)
}
// Command line
- SPRINTF(buf, "Command: ");
- for (i = 0; i < VG_(client_argc); i++) {
- if (VG_(client_argv)[i])
- SPRINTF(buf, "%s ", VG_(client_argv)[i]);
+ SPRINTF(buf, "Command:");
+ if (VG_(args_the_exename)) {
+ SPRINTF(buf, " %s", VG_(args_the_exename));
+ }
+ for (i = 0; i < VG_(args_for_client).used; i++) {
+ if (VG_(args_for_client).strs[i])
+ SPRINTF(buf, " %s", VG_(args_for_client).strs[i]);
}
SPRINTF(buf, "\n%s\n", maybe_p);
@@ -1818,7 +1828,7 @@ static void ms_pre_clo_init()
tl_assert( VG_(getcwd)(base_dir, VKI_PATH_MAX) );
}
-VG_DETERMINE_INTERFACE_VERSION(ms_pre_clo_init, 0)
+VG_DETERMINE_INTERFACE_VERSION(ms_pre_clo_init)
/*--------------------------------------------------------------------*/
/*--- end ---*/