Konstantin Ladutenko 10 years ago
parent
commit
238f3a3a98
3 changed files with 63 additions and 4 deletions
  1. 4 0
      .gitignore
  2. 16 4
      go.sh
  3. 43 0
      tests/shell/opreport.log

+ 4 - 0
.gitignore

@@ -32,3 +32,7 @@
 
 # Temp
 *~
+oprofiletmp
+callgrind
+oprofile_data
+out.dot

+ 16 - 4
go.sh

@@ -6,13 +6,13 @@ rm -f ../scattnlay
 # g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay-pg.bin -static -pg
 
 #google profiler
-# g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay.bin /usr/lib/libtcmalloc.so.4 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free 
- g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay.bin -ltcmalloc -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free 
+g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay.bin /usr/lib/libtcmalloc.so.4 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free 
+ g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay-g.bin -ltcmalloc -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -g
 
 #clang++ -g -O1 -fsanitize=address  -fno-optimize-sibling-calls -fno-omit-frame-pointer -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay.bin
 
 cp scattnlay.bin ../scattnlay
-cp scattnlay-pg.bin ../scattnlay-pg
+cp scattnlay-g.bin ../scattnlay-g
 cd tests/shell
 # for file in `ls *.sh`;  do 
 #     if [ "$file" != "test03.sh" ]; then
@@ -25,7 +25,19 @@ cd tests/shell
 #time 
 time $PROGRAM -l 5 0.4642 1.8000 1.7000 0.7114 0.8000 0.7000 0.7393 1.2000 0.0900 0.9168 2.8000 0.2000 1.0000 1.5000 0.4000  -t 0.0 90.0 5 -c test01
 
-echo valgring
+#apt-get install oprofile
+echo oprofile
+PROGRAM='../../../scattnlay-g'
+# time ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4 
+#time 
+rm -rf oprofiletmp
+rm -rf oprofile_data
+time operf $PROGRAM -l 5 0.4642 1.8000 1.7000 0.7114 0.8000 0.7000 0.7393 1.2000 0.0900 0.9168 2.8000 0.2000 1.0000 1.5000 0.4000  -t 0.0 90.0 5 -c test01
+opreport --symbols > opreport.log
+mkdir oprofiletmp
+opannotate --source --output-dir=./oprofiletmp/
+
+#echo valgring
 # valgrind --tool=callgrind $PROGRAM -l 5 0.4642 1.8000 1.7000 0.7114 0.8000 0.7000 0.7393 1.2000 0.0900 0.9168 2.8000 0.2000 1.0000 1.5000 0.4000  -t 0.0 90.0 5 -c test01
 # rm out.dot
 # ./gprof2dot.py --output=out.dot --format=callgrind callgrind.out.*

+ 43 - 0
tests/shell/opreport.log

@@ -0,0 +1,43 @@
+CPU: Intel Haswell microarchitecture, speed 2900 MHz (estimated)
+Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
+samples  %        image name               symbol name
+32438    42.5975  scattnlay-g              nmie::MultiLayerMie::calcD1D3(std::complex<double>, std::vector<std::complex<double>, std::allocator<std::complex<double> > >&, std::vector<std::complex<double>, std::allocator<std::complex<double> > >&)
+22678    29.7807  scattnlay-g              nmie::MultiLayerMie::ScattCoeffs(std::vector<std::complex<double>, std::allocator<std::complex<double> > >&, std::vector<std::complex<double>, std::allocator<std::complex<double> > >&)
+4994      6.5581  libtcmalloc.so.4.1.2     /usr/lib/libtcmalloc.so.4.1.2
+3649      4.7919  scattnlay-g              nmie::MultiLayerMie::RunMieCalculations()
+2064      2.7104  libm-2.19.so             __cos_avx
+1542      2.0250  libm-2.19.so             __sin_avx
+1523      2.0000  libm-2.19.so             __ieee754_exp_avx
+1490      1.9567  scattnlay-g              std::vector<std::complex<double>, std::allocator<std::complex<double> > >::_M_default_append(unsigned long)
+1472      1.9330  scattnlay-g              nmie::MultiLayerMie::calcPiTau(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&)
+1286      1.6888  libm-2.19.so             __dubsin
+1003      1.3171  scattnlay-g              std::vector<double, std::allocator<double> >::_M_default_append(unsigned long) [clone .part.138]
+488       0.6408  no-vmlinux               /no-vmlinux
+303       0.3979  scattnlay-g              nmie::MultiLayerMie::Nmax(int)
+265       0.3480  libc-2.19.so             memset
+222       0.2915  scattnlay-g              std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >::_M_default_append(unsigned long) [clone .part.146]
+189       0.2482  libm-2.19.so             sincos
+147       0.1930  scattnlay-g              nmie::nMie_wrapper(int, std::vector<double, std::allocator<double> > const&, std::vector<std::complex<double>, std::allocator<std::complex<double> > > const&, int, std::vector<double, std::allocator<double> > const&, double*, double*, double*, double*, double*, double*, double*, std::vector<std::complex<double>, std::allocator<std::complex<double> > >&, std::vector<std::complex<double>, std::allocator<std::complex<double> > >&)
+127       0.1668  scattnlay-g              nmie::MultiLayerMie::SetWidthSP(std::vector<double, std::allocator<double> > const&)
+96        0.1261  libm-2.19.so             csloww
+80        0.1051  scattnlay-g              std::vector<std::complex<double>, std::allocator<std::complex<double> > >::operator=(std::vector<std::complex<double>, std::allocator<std::complex<double> > > const&)
+29        0.0381  scattnlay-g              nmie::MultiLayerMie::InitMieCalculations()
+29        0.0381  scattnlay-g              std::vector<double, std::allocator<double> >::operator=(std::vector<double, std::allocator<double> > const&)
+8         0.0105  scattnlay-g              main
+4         0.0053  ld-2.19.so               _dl_relocate_object
+4         0.0053  ld-2.19.so               do_lookup_x
+3         0.0039  ld-2.19.so               check_match.9459
+3         0.0039  libstdc++.so.6.0.20      /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20
+2         0.0026  ld-2.19.so               _dl_lookup_symbol_x
+1         0.0013  ld-2.19.so               _dl_cache_libcmp
+1         0.0013  ld-2.19.so               _dl_check_map_versions
+1         0.0013  ld-2.19.so               strcmp
+1         0.0013  libc-2.19.so             __GI_strncmp
+1         0.0013  libc-2.19.so             ____strtod_l_internal
+1         0.0013  libc-2.19.so             __mpn_mul
+1         0.0013  libc-2.19.so             __printf_chk
+1         0.0013  libc-2.19.so             __strcmp_sse2_unaligned
+1         0.0013  libc-2.19.so             getenv
+1         0.0013  libm-2.19.so             __ieee754_log_avx
+1         0.0013  libunwind.so.8.0.1       /usr/lib/x86_64-linux-gnu/libunwind.so.8.0.1
+1         0.0013  scattnlay-g              calcPiTau(int, double, std::vector<double, std::allocator<double> >&, std::vector<double, std::allocator<double> >&)