无法打开文件进行性能分析

时间:2013-11-24 22:53:20

标签: c++ c valgrind

我正在运行一个C / C ++程序,它试图打开保存在磁盘上的文件。如果我运行程序没有cachegrind它运行完美。但是如果我用cachegrind运行程序,我会收到以下错误。有人可以帮我纠正错误:

==25989== Cachegrind, a cache and branch-prediction profiler
==25989== Copyright (C) 2002-2011, and GNU GPL'd, by Nicholas Nethercote et al.
==25989== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==25989== Command: ./executionFile --main-stacksize=1000000000000
==25989== 
--25989-- warning: L3 cache found, using its data for the LL simulation.
--25989-- warning: pretending that LL cache has associativity 30 instead of actual 20
==25989== 
==25989== Process terminating with default action of signal 11 (SIGSEGV)
==25989==  Access not within mapped region at address 0xFFFFFFFFFFFFFFFF
==25989==    at 0x409D01: MyFile::open(char const*, bool) (MyFile.cpp:117)
==25989==    by 0x4042C5: main (executionFile.cpp:193)
==25989==  If you believe this happened as a result of a stack
==25989==  overflow in your program's main thread (unlikely but
==25989==  possible), you can try to increase the size of the
==25989==  main thread stack using the --main-stacksize= flag.
==25989==  The main thread stack size used in this run was 8388608.
==25989== 
==25989== I   refs:      1,642,435
==25989== I1  misses:        1,695
==25989== LLi misses:        1,655
==25989== I1  miss rate:      0.10%
==25989== LLi miss rate:      0.10%
==25989== 
==25989== D   refs:        542,393  (404,546 rd   + 137,847 wr)
==25989== D1  misses:       13,170  ( 11,239 rd   +   1,931 wr)
==25989== LLd misses:        7,961  (  6,510 rd   +   1,451 wr)
==25989== D1  miss rate:       2.4% (    2.7%     +     1.4%  )
==25989== LLd miss rate:       1.4% (    1.6%     +     1.0%  )
==25989== 
==25989== LL refs:          14,865  ( 12,934 rd   +   1,931 wr)
==25989== LL misses:         9,616  (  8,165 rd   +   1,451 wr)
==25989== LL miss rate:        0.4% (    0.3%     +     1.0%  )

我需要进行性能分析才能找出缓存未命中数。 有人可以帮我纠正错误

编辑: 我正在尝试使用以下方式打开我的文件:

   int file=::open(name_of_my_File,readOnly?O_RDONLY:O_RDWR);

0 个答案:

没有答案