Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

fix lttng being optional #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions src/performance/perfcollect/perfcollect
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash

#############################################################################################################
# .NET Performance Data Collection Script
Expand Down Expand Up @@ -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'.
#############################################################################################################

######################################
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -867,7 +870,7 @@ IsUbuntu()
ubuntu=1
fi
fi

echo $ubuntu
}

Expand Down Expand Up @@ -1039,7 +1042,7 @@ SupportsAutoInstall()
then
supportsAutoInstall=1
fi

echo $supportsAutoInstall
}

Expand Down Expand Up @@ -1077,7 +1080,10 @@ EnsurePrereqsInstalled()
echo "Install LTTng to proceed."
fi
ResetText
exit 1
if (( $useLTTng == 1 ))
then
exit 1
fi

fi

Expand Down Expand Up @@ -1129,7 +1135,7 @@ ProcessArguments()
then
return
fi

# Not enough arguments.
if [ "$#" -le "1" ]
then
Expand Down Expand Up @@ -1223,7 +1229,7 @@ ProcessArguments()
echo "Unknown arg ${arg}, ignored..."
fi
done

}


Expand Down Expand Up @@ -1542,7 +1548,7 @@ ProcessCollectedData()
fi

WriteStatus "Compressing trace files"

# Move all collected files to the new directory.
RunSilent "mv * $directoryName"

Expand Down Expand Up @@ -1664,7 +1670,7 @@ BuildPerfRecordArgs()
then
collectionArgs="$collectionArgs -e cycles,instructions,branches,cache-misses"
fi

# Enable context switches.
if [ $collect_threadTime -eq 1 ]
then
Expand Down Expand Up @@ -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"
}

Expand Down Expand Up @@ -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`
Expand All @@ -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`
Expand Down Expand Up @@ -1834,7 +1840,7 @@ DoView()
then
babeltrace lttngTrace/ | more
fi

# Switch back to the original directory.
popd

Expand All @@ -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" ]
Expand Down