Merge branch 'master' into memleak-finder
[lttng-tools.git] / memleak / start-bin
CommitLineData
1c353010
DG
1#!/bin/bash
2#
3# Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
4#
5# This program is free software; you can redistribute it and/or modify it under
6# the terms of the GNU General Public License, version 2 only, as published by
7# the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12# details.
13#
14# You should have received a copy of the GNU General Public License along with
15# this program; if not, write to the Free Software Foundation, Inc., 51
16# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18LIB_MEMLEAK="lttng-memleak-finder.so"
19LIB_STATS="lttng-malloc-stats.so"
20
21ld_preload_lib="./$LIB_MEMLEAK"
22
23if [ -z "$1" ]; then
24 echo "Usage: $0 [--stats] PROG"
25 exit 1
26fi
27
28if [ ! -f ./$LIB_MEMLEAK -a ! -f ./$LIB_STATS ]; then
29 echo "Please compile the $LIB_STATS and/or $LIB_MEMLEAK first."
30 exit 1
31fi
32
33if [ "$1" = "--stats" ]; then
34 ld_preload_lib="./$LIB_STATS"
35 shift
36fi
37
38LD_PRELOAD=$ld_preload_lib $@
This page took 0.023921 seconds and 4 git commands to generate.