Browse Source

tools: starpu_codelet_profile and starpu_codelet_histo_profile honors -v option

Nathalie Furmento 12 years ago
parent
commit
b87d198aed
4 changed files with 49 additions and 11 deletions
  1. 5 1
      configure.ac
  2. 2 2
      tools/Makefile.am
  3. 21 4
      tools/starpu_codelet_histo_profile
  4. 21 4
      tools/starpu_codelet_profile

+ 5 - 1
configure.ac

@@ -1,7 +1,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
 # Copyright (C) 2009-2013  Université de Bordeaux 1
-# Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+# Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
 # Copyright (C) 2011  Télécom-SudParis
 # Copyright (C) 2011, 2012  Institut National de Recherche en Informatique et Automatique
 #
@@ -1828,6 +1828,8 @@ AC_SUBST([LIBSTARPU_LINK])
 AC_CONFIG_COMMANDS([executable-scripts], [
   chmod +x tests/regression/regression.sh
   chmod +x gcc-plugin/tests/run-test
+  chmod +x tools/starpu_codelet_profile
+  chmod +x tools/starpu_codelet_histo_profile
   chmod +x tools/starpu_workers_activity
 ])
 
@@ -1849,6 +1851,8 @@ AC_OUTPUT([
 	Makefile
 	src/Makefile
 	tools/Makefile
+	tools/starpu_codelet_profile
+	tools/starpu_codelet_histo_profile
 	tools/starpu_workers_activity
 	socl/Makefile
 	socl/src/Makefile

+ 2 - 2
tools/Makefile.am

@@ -116,10 +116,10 @@ starpu_workers_activity.1: starpu_workers_activity$(EXEEXT)
 	help2man --no-discard-stderr -N --output=$@ ./$<
 starpu_codelet_profile.1: starpu_codelet_profile$(EXEEXT)
 	chmod +x $<
-	help2man --no-discard-stderr -N --output=$@ $<
+	help2man --no-discard-stderr -N --output=$@ ./$<
 starpu_codelet_histo_profile.1: starpu_codelet_histo_profile$(EXEEXT)
 	chmod +x $<
-	help2man --no-discard-stderr -N --output=$@ $<
+	help2man --no-discard-stderr -N --output=$@ ./$<
 
 if STARPU_USE_FXT
 starpu_fxt_tool.1: starpu_fxt_tool$(EXEEXT)

+ 21 - 4
tools/starpu_codelet_histo_profile

@@ -3,7 +3,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 # 
 # Copyright (C) 2009, 2010, 2013  Université de Bordeaux 1
-# Copyright (C) 2010  Centre National de la Recherche Scientifique
+# Copyright (C) 2010, 2013  Centre National de la Recherche Scientifique
 # 
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -16,12 +16,29 @@
 # 
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
-if [ "$#" -lt 2 -o "$1" = --help -o "$1" = -h ]
-then
+PROGNAME=$0
+
+usage()
+{
 	echo "Offline tool to draw codelet profile histogram over a traced execution"
 	echo ""
-	echo "Usage: $0 distrib.data"
+	echo "Usage: $PROGNAME distrib.data"
+	echo ""
+	echo "Options:"
+	echo "	-h, --help          display this help and exit"
+	echo "	-v, --version       output version information and exit"
+	echo ""
+	echo "Report bugs to <@PACKAGE_BUGREPORT@>"
 	exit 1
+}
+
+if [ "$1" = "-v" ] || [ "$1" = "--version" ] ; then
+    echo "$PROGNAME (@PACKAGE_NAME@) @PACKAGE_VERSION@"
+    exit 0
+fi
+
+if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "" ] ; then
+    usage
 fi
 
 create_histograms()

+ 21 - 4
tools/starpu_codelet_profile

@@ -3,7 +3,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 # 
 # Copyright (C) 2008, 2009, 2010, 2013  Université de Bordeaux 1
-# Copyright (C) 2010  Centre National de la Recherche Scientifique
+# Copyright (C) 2010, 2013  Centre National de la Recherche Scientifique
 # 
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -16,12 +16,29 @@
 # 
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
-if [ "$#" -lt 2 -o "$1" = --help -o "$1" = -h ]
-then
+PROGNAME=$0
+
+usage()
+{
 	echo "Offline tool to draw codelet profile over a traced execution"
 	echo ""
-	echo "Usage: $0 distrib.data codelet_name"
+	echo "Usage: $PROGNAME distrib.data codelet_name"
+	echo ""
+	echo "Options:"
+	echo "	-h, --help          display this help and exit"
+	echo "	-v, --version       output version information and exit"
+	echo ""
+	echo "Report bugs to <@PACKAGE_BUGREPORT@>"
 	exit 1
+}
+
+if [ "$1" = "-v" ] || [ "$1" = "--version" ] ; then
+    echo "$PROGNAME (@PACKAGE_NAME@) @PACKAGE_VERSION@"
+    exit 0
+fi
+
+if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$2" = "" ] ; then
+    usage
 fi
 
 inputfile=$1