From e96d91365a5800bfb4400529e1924bbb4d84f0f4 Mon Sep 17 00:00:00 2001 From: woojin Date: Wed, 17 Apr 2013 16:58:38 +0900 Subject: [PATCH] add new commands for valgrind Change-Id: I561d5005f707c2ad327b162f3dcdfb21646e2a83 --- utils/oprofile_command | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/utils/oprofile_command b/utils/oprofile_command index f6220fc..9c1ec17 100755 --- a/utils/oprofile_command +++ b/utils/oprofile_command @@ -6,6 +6,8 @@ OPHELP=/usr/bin/ophelp VALGRIND=/home/developer/sdk_tools/valgrind/usr/bin/valgrind GETMACHINEINFO="/bin/uname -m" CHMOD=/bin/chmod +GETPID=/bin/pidof +SENDSIGQUIT="kill -3" is_app_executable() { @@ -19,7 +21,7 @@ is_app_executable() is_emulator() { MACHINE=`$GETMACHINEINFO` - if [[ $MACHINE =~ .*emulated.* ]] ; then + if [[ $MACHINE =~ .*emulat.* ]] ; then return 1 else return 0 @@ -193,6 +195,12 @@ valgrind_chmod_result() $CHMOD 777 $RESULTDIRECTORY/* } +valgrind_terminate_app() +{ + PID=`$GETPID $VALGRIND` + $SENDSIGQUIT $PID +} + echo $@ #echo $@ >> /home/developer/oprofile_history @@ -306,6 +314,14 @@ if [[ -n $1 ]]; then fi valgrind_chmod_result ;; + valgrind_terminate) + is_emulator + if [[ "$?" -ne 1 ]] ; then + echo "Valgrind option is available only on the emulator!" + exit 1 + fi + valgrind_terminate_app + ;; *) echo "Unknown option!" >&2 exit 1 -- 2.7.4