From 32d09b0fbb43de92907f1040e5cb33506fcdfc6b Mon Sep 17 00:00:00 2001 From: Patrick Baudin <patrick.baudin@cea.fr> Date: Thu, 2 Jun 2022 11:59:09 +0200 Subject: [PATCH] add .sh to devel_tools/frama-c-callgrind --- devel_tools/frama-c-callgrind | 31 ------------------- devel_tools/frama-c-callgrind.sh | 52 ++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 31 deletions(-) delete mode 100755 devel_tools/frama-c-callgrind create mode 100755 devel_tools/frama-c-callgrind.sh diff --git a/devel_tools/frama-c-callgrind b/devel_tools/frama-c-callgrind deleted file mode 100755 index 3e23c01dbd8..00000000000 --- a/devel_tools/frama-c-callgrind +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Script for profiling Frama-C with callgrind (a valgrind tool). -# Note: execution time with valgrind is about 15x-20x slower. -# -# Use this script at the root of the repository, so local_export.sh can be found -# in bin. -# For more focused results, you can activate the profiling only after entering -# a specific function. For instance, to only profile Eva, add -# -# --toggle-collect='*Eva__Analysis__force_compute*' -# -# to the command line below. -# -# Example of invocation : -# -# devel_tools/frama-c-callgrind tests/idct/*.c -eva -float-normal -no-warn-signed-overflow -# -# This creates a 'callgrind.out' file (Callgrind format), which can be viewed -# with a tool such as kcachegrind: -# -# kcachegrind callgrind.out - -BASH_ARGV0="bin/frama-c" # hackish way to tell local_export that its dir is bin - -. bin/local_export.sh - -valgrind \ - --tool=callgrind --callgrind-out-file=callgrind.out --dump-instr=yes \ - --separate-callers=2 --collect-jumps=yes --fn-skip='caml_*' \ - $BINDIR/toplevel.opt "$@" diff --git a/devel_tools/frama-c-callgrind.sh b/devel_tools/frama-c-callgrind.sh new file mode 100755 index 00000000000..1de367e65fe --- /dev/null +++ b/devel_tools/frama-c-callgrind.sh @@ -0,0 +1,52 @@ +#!/bin/bash +########################################################################## +# # +# This file is part of Frama-C. # +# # +# Copyright (C) 2007-2022 # +# CEA (Commissariat à l'énergie atomique et aux énergies # +# alternatives) # +# # +# you can redistribute it and/or modify it under the terms of the GNU # +# Lesser General Public License as published by the Free Software # +# Foundation, version 2.1. # +# # +# It 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 Lesser General Public License for more details. # +# # +# See the GNU Lesser General Public License version 2.1 # +# for more details (enclosed in the file licenses/LGPLv2.1). # +# # +########################################################################## + +# Script for profiling Frama-C with callgrind (a valgrind tool). +# Note: execution time with valgrind is about 15x-20x slower. +# +# Use this script at the root of the repository, so local_export.sh can be found +# in bin. +# For more focused results, you can activate the profiling only after entering +# a specific function. For instance, to only profile Eva, add +# +# --toggle-collect='*Eva__Analysis__force_compute*' +# +# to the command line below. +# +# Example of invocation : +# +# devel_tools/frama-c-callgrind tests/idct/*.c -eva -float-normal -no-warn-signed-overflow +# +# This creates a 'callgrind.out' file (Callgrind format), which can be viewed +# with a tool such as kcachegrind: +# +# kcachegrind callgrind.out + +BASH_ARGV0="bin/frama-c" # hackish way to tell local_export that its dir is bin + +. bin/local_export.sh + +valgrind \ + --tool=callgrind --callgrind-out-file=callgrind.out --dump-instr=yes \ + --separate-callers=2 --collect-jumps=yes --fn-skip='caml_*' \ + $BINDIR/toplevel.opt "$@" -- GitLab