memleak: Print error message if fewer than 2 arguments are supplied.
This commit is contained in:
parent
a5c0238573
commit
670bfe4311
@ -3,21 +3,27 @@
|
||||
# smem -P '^myprogram' -t | tail -n1 \
|
||||
# | awk '{print "USS:", $4; print "PSS:",$5; print "RSS:",$6; print "SWP:",$3;}' \
|
||||
# | sed "s/:/ $(date --iso-8601=minutes)/" >> mem-myprogram.data
|
||||
|
||||
#
|
||||
# Arguments: <program name> <time of first data point> [width] [height]
|
||||
# Example usage: ./memory-consumption-over-time.gp myprogram 2021-12-05T08:42
|
||||
|
||||
if (ARGC > 0) {
|
||||
if (ARGC < 2) {
|
||||
printerr "You probably want to supply the program name ", \
|
||||
"and the time of first data point. ", \
|
||||
"See the header of this script for more information."
|
||||
}
|
||||
|
||||
myprog='unknown'
|
||||
if (ARGC >= 1) {
|
||||
myprog = ARG1
|
||||
} else {
|
||||
myprog='unknown'
|
||||
}
|
||||
infile=sprintf('mem-%s.data', myprog)
|
||||
|
||||
mytimefmt = "%Y-%m-%dT%H:%M"
|
||||
if (ARGC > 1) {
|
||||
mystarttime = strptime(mytimefmt, "1970-01-01T00:00")
|
||||
if (ARGC >= 2) {
|
||||
mystarttime = strptime(mytimefmt, ARG2)
|
||||
} else {
|
||||
mystarttime = strptime(mytimefmt, "1970-01-01T00:00")
|
||||
}
|
||||
}
|
||||
|
||||
set title sprintf('%s memory consumption over time', myprog)
|
||||
|
Loading…
x
Reference in New Issue
Block a user