diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index ffed618..68b1757 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash ############################################################################################################# # .NET Performance Data Collection Script @@ -29,7 +29,7 @@ # 1. Run this script: ./perfcollect view samplePerfTrace.trace.zip # This will extract the trace, place and register all symbol files and JIT-compiled symbol information # and start the perf_event viewer. By default, you will be looking at a callee view - stacks are ordered -# top down. For a caller or bottom up view, specify '-graphtype caller'. +# top down. For a caller or bottom up view, specify '-graphtype caller'. ############################################################################################################# ###################################### @@ -666,7 +666,10 @@ InitializeLog() # The system information. LogAppend 'Machine info: ' `uname -a` LogAppend 'perf version:' `$perfcmd --version` - LogAppend 'LTTng version: ' `lttng --version` + if (($useLTTng == 1)) + then + LogAppend 'LTTng version: ' `lttng --version` + fi LogAppend } @@ -867,7 +870,7 @@ IsUbuntu() ubuntu=1 fi fi - + echo $ubuntu } @@ -1039,7 +1042,7 @@ SupportsAutoInstall() then supportsAutoInstall=1 fi - + echo $supportsAutoInstall } @@ -1077,7 +1080,10 @@ EnsurePrereqsInstalled() echo "Install LTTng to proceed." fi ResetText - exit 1 + if (( $useLTTng == 1 )) + then + exit 1 + fi fi @@ -1129,7 +1135,7 @@ ProcessArguments() then return fi - + # Not enough arguments. if [ "$#" -le "1" ] then @@ -1223,7 +1229,7 @@ ProcessArguments() echo "Unknown arg ${arg}, ignored..." fi done - + } @@ -1542,7 +1548,7 @@ ProcessCollectedData() fi WriteStatus "Compressing trace files" - + # Move all collected files to the new directory. RunSilent "mv * $directoryName" @@ -1664,7 +1670,7 @@ BuildPerfRecordArgs() then collectionArgs="$collectionArgs -e cycles,instructions,branches,cache-misses" fi - + # Enable context switches. if [ $collect_threadTime -eq 1 ] then @@ -1694,7 +1700,7 @@ BuildPerfRecordArgs() durationString="sleep ${duration}" fi - # Add the events onto the collection command line args. + # Add the events onto the collection command line args. collectionArgs="$collectionArgs -e $eventString $durationString" } @@ -1776,7 +1782,7 @@ DoLiveTrace() PropSymbolsAndMapFilesForView() { # Get the current directory - local currentDir=`pwd` + local currentDir=`pwd` # Copy map files to /tmp since they aren't supported by perf buildid-cache. local mapFiles=`find -name *.map` @@ -1799,10 +1805,10 @@ DoView() { # Generate a temp directory to extract the trace files into. local tempDir=`mktemp -d` - + # Extract the trace files. $unzipcmd $inputTraceName -d $tempDir - + # Move the to temp directory. pushd $tempDir cd `ls` @@ -1834,7 +1840,7 @@ DoView() then babeltrace lttngTrace/ | more fi - + # Switch back to the original directory. popd @@ -1854,14 +1860,14 @@ then exit 0 fi -# Ensure prerequisites are installed. -EnsurePrereqsInstalled +# Process arguments. +ProcessArguments $@ # Initialize the log. InitializeLog -# Process arguments. -ProcessArguments $@ +# Ensure prerequisites are installed. +EnsurePrereqsInstalled # Take the appropriate action. if [ "$action" == "collect" ]