blob: 89c2e71bf6961967ca26ab8cbb7d192f507d40ba [file] [log] [blame]
#!/bin/bash
# Copyright (c) 2017 FH Dortmund and others
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Description:
# This script is used for monitoring core utilization of all threads of
# a process by the process name.
# Right usage: MonitorThreads.sh <process_name>
# e.g. MonitorThreads.sh <process_name>
#
# Authors:
# M. Ozcelikors <mozcelikors@gmail.com>, FH Dortmund
#
args=("$@")
process_name=${args[0]}
if [ "$#" -ne 1 ]; then
echo "Entered arguments seem to be incorrect"
echo "Right usage: MonitorThreads.sh <process_name>"
echo "e.g. MonitorThreads.sh <process_name>"
else
pid=$(pgrep -f $process_name -o)
top H -p $pid
fi