File: benchmark.sh

package info (click to toggle)
afflib 3.7.22-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,584 kB
  • sloc: cpp: 20,911; ansic: 15,912; makefile: 520; sh: 436; python: 192
file content (23 lines) | stat: -rw-r--r-- 772 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
#
# perform some performance testing
# This file is a work of a US government employee and as such is in the Public domain.
# Simson L. Garfinkel, March 12, 2012
# 
echo Building aftest with profiling
(cd .. ; make distclean; ./configure CFLAGS="-p -pg" CPPFLAGS="-p -pg" CXXFLAGS="-p -pg" ; make)
cp aftest aftest.prof
./aftest.prof -1
gprof -c aftest.prof gmon.out > aftest.gmon.txt

echo Re-Building aftest without profiling
(cd .. ; make distclean; ./configure ; make)

echo Running time tests 

echo try it with auditing
sudo dtruss ./aftest -1 2>aftest.dtruss
echo number of lseeks: `grep lseek aftest.dtruss  | wc -l`
echo number of reads: `grep read_nocancel aftest.dtruss  | wc -l`
echo number of writes: `grep write_nocancel aftest.dtruss  | wc -l`