'프로그램 사용/valgrind'에 해당되는 글 5건

  1. 2023.07.07 valgrind callgrind
  2. 2022.01.18 valgrind 누수 종류
  3. 2022.01.14 vaglind 사용
  4. 2014.10.15 valgrind 지원 플랫폼
  5. 2014.10.15 valgrind GUI frontend- kcachegrind / valkyrie

valgrind는 일반적으로 메모리 누수를 찾는데 쓰지만

call graph라고 해야하나? call 관련 추적도 가능하다고 하니 다음에 돌려봐야겠다.

 tool에 여러가지 있는데 cachegrind 정도만 찾아봤던 흔적이 있네..

 

$ valgrind --tool=
32bit-core     arm-core       i386           mips64-cpu     power64-linux
32bit-linux    arm-vfpv3      lackey         mips64-fpu     powerpc
32bit-sse      arm-with       massif         none           s390-acr
64bit-avx      cachegrind     memcheck       power-altivec  s390-fpr
64bit-core     callgrind      mips           power-core     s390-vx
64bit-linux    dhat           mips-cp0       power-fpu      s390x
64bit-sse      drd            mips-cpu       power-linux    s390x-core64
amd64          exp-bbv        mips-fpu       power-vsx      s390x-linux64
amd64-avx      getoff         mips64         power64-core   s390x-vx
arm            helgrind       mips64-cp0     power64-core2  

 

 

[링크 : https://jchern.tistory.com/13]

[링크 : https://velog.io/@wjddms206/Valgrind-프로파일러-callgrind]

 

 

+

[링크 : http://www.cs.columbia.edu/~sedwards/presentations/iccad2003-somenzi.pdf]

[링크 : https://fileadmin.cs.lth.se/cs/Education/EDAF15/labs/lab4/index.html]

'프로그램 사용 > valgrind' 카테고리의 다른 글

valgrind 누수 종류  (0) 2022.01.18
vaglind 사용  (0) 2022.01.14
valgrind 지원 플랫폼  (0) 2014.10.15
valgrind GUI frontend- kcachegrind / valkyrie  (0) 2014.10.15
Posted by 구차니

상세 내용이 있으나 너무 길어서 눈에 안들어 오는데..

아무튼 요약하면 Direct는 일반 포인터, indirect는 링크드 리스크나 멀티 포인터 인데

이중할당해서 이전 할당을 추적하지 않을 경우라고 보면 될 듯.

     Pointer chain            AAA Leak Case   BBB Leak Case
     -------------            -------------   -------------
(1)  RRR ------------> BBB                    DR
(2)  RRR ---> AAA ---> BBB    DR              IR
(3)  RRR               BBB                    DL
(4)  RRR      AAA ---> BBB    DL              IL
(5)  RRR ------?-----> BBB                    (y)DR, (n)DL
(6)  RRR ---> AAA -?-> BBB    DR              (y)IR, (n)DL
(7)  RRR -?-> AAA ---> BBB    (y)DR, (n)DL    (y)IR, (n)IL
(8)  RRR -?-> AAA -?-> BBB    (y)DR, (n)DL    (y,y)IR, (n,y)IL, (_,n)DL
(9)  RRR      AAA -?-> BBB    DL              (y)IL, (n)DL

Pointer chain legend:
- RRR: a root set node or DR block
- AAA, BBB: heap blocks
- --->: a start-pointer
- -?->: an interior-pointer

Leak Case legend:
- DR: Directly reachable
- IR: Indirectly reachable
- DL: Directly lost
- IL: Indirectly lost
- (y)XY: it's XY if the interior-pointer is a real pointer
- (n)XY: it's XY if the interior-pointer is not a real pointer
- (_)XY: it's XY in either case
Every possible case can be reduced to one of the above nine. Memcheck merges some of these cases in its output, resulting in the following four leak kinds.

"Still reachable". This covers cases 1 and 2 (for the BBB blocks) above. A start-pointer or chain of start-pointers to the block is found. Since the block is still pointed at, the programmer could, at least in principle, have freed it before program exit. "Still reachable" blocks are very common and arguably not a problem. So, by default, Memcheck won't report such blocks individually.

"Definitely lost". This covers case 3 (for the BBB blocks) above. This means that no pointer to the block can be found. The block is classified as "lost", because the programmer could not possibly have freed it at program exit, since no pointer to it exists. This is likely a symptom of having lost the pointer at some earlier point in the program. Such cases should be fixed by the programmer.

"Indirectly lost". This covers cases 4 and 9 (for the BBB blocks) above. This means that the block is lost, not because there are no pointers to it, but rather because all the blocks that point to it are themselves lost. For example, if you have a binary tree and the root node is lost, all its children nodes will be indirectly lost. Because the problem will disappear if the definitely lost block that caused the indirect leak is fixed, Memcheck won't report such blocks individually by default.

"Possibly lost". This covers cases 5--8 (for the BBB blocks) above. This means that a chain of one or more pointers to the block has been found, but at least one of the pointers is an interior-pointer. This could just be a random value in memory that happens to point into a block, and so you shouldn't consider this ok unless you know you have interior-pointers.

[링크 : https://valgrind.org/docs/manual/mc-manual.html#mc-manual.leaks]

 

"still reachable" (memory that is pointed to by a pointer).
"directly lost" (memory that is not pointed to be any live pointer)
"indirectly lost" (memory that is pointed to by a pointer that is in memory that is "directly lost)
"possibly lost" (memory that is pointed to, but the pointer does not point to the start of the memory).

[링크 : https://stackoverflow.com/questions/24201561/valgrind-memory-leak-log]

 

 

'프로그램 사용 > valgrind' 카테고리의 다른 글

valgrind callgrind  (0) 2023.07.07
vaglind 사용  (0) 2022.01.14
valgrind 지원 플랫폼  (0) 2014.10.15
valgrind GUI frontend- kcachegrind / valkyrie  (0) 2014.10.15
Posted by 구차니

 

valgrind --leak-check=full ./run_file

[링크 : https://m.blog.naver.com/cksdn788/220380070991]

'프로그램 사용 > valgrind' 카테고리의 다른 글

valgrind callgrind  (0) 2023.07.07
valgrind 누수 종류  (0) 2022.01.18
valgrind 지원 플랫폼  (0) 2014.10.15
valgrind GUI frontend- kcachegrind / valkyrie  (0) 2014.10.15
Posted by 구차니
프로그램 사용/valgrind2014. 10. 15. 17:34
valgrind 3.3 에 대한 tag를 svn으로 받아서 보니..
i?86 / x86_64/ powerpc / powerpc64 만을 지원한다 -_-

valgrind 3.8 에서는 ARM을 지원하나 ARMv7만을 지원하고
이녀석들은.. Cortex 시리즈용 아키텍쳐다 ㅠㅠ
ARM925 이런건 실행도 못해본다 -_ㅠ
ArchitectureBit
width
Cores designed by ARM HoldingsCores designed by third partiesCortex profileReferences
ARMv1
32/26
ARM1
ARMv2
32/26
ARM2ARM3 Amber, STORM Open Soft Core[28]
ARMv3
32
ARM6ARM7
ARMv4
32
ARM8 StrongARM, FA526
ARMv4T
32
ARM7TDMIARM9TDMI
ARMv5
32
ARM7EJARM9EARM10E XScale, FA626TE, Feroceon, PJ1/Mohawk
ARMv6
32
ARM11
ARMv6-M
32
ARM Cortex-M0ARM Cortex-M0+ARM Cortex-M1 Microcontroller
ARMv7-M
32
ARM Cortex-M3
Microcontroller
ARMv7E-M
32
ARM Cortex-M4
Microcontroller
ARMv7-R
32
ARM Cortex-R4ARM Cortex-R5ARM Cortex-R7
Real-time
ARMv7-A
32
ARM Cortex-A5ARM Cortex-A7ARM Cortex-A8ARM Cortex-A9ARM Cortex-A12ARM Cortex-A15ARM Cortex-A17 KraitScorpion, PJ4/Sheeva, Apple A6/A6X (Swift)
Application
ARMv8-A
64/32
ARM Cortex-A53ARM Cortex-A57[29] X-GeneNvidia Project DenverApple A7 (Cyclone), AMD K12Apple A8
Application
[30][31]
ARMv8-R
32
No announcements yet
Real-time
[32][33]
[링크 : http://en.wikipedia.org/wiki/ARM_architecture#Cores]

Current

Valgrind supports the following platforms:
x86/Linux: support is mature and almost complete.
AMD64/Linux: support is mature and almost complete. Note that AMD64 is just another name for x86-64, and that Valgrind works fine on Intel machines.
PPC32/Linux: support is new but fairly complete.
PPC64/Linux: support is new but fairly complete.
x86/Darwin (Mac OS X): support is new.
AMD64/Darwin (Mac OS X): support is new.
S390X/Linux: support is new in 3.7.0.
ARM/Linux support for ARMv7 is fairly complete.
ARM/Android support is new in 3.7.0.
MIPS32/Linux support is new in 3.8.0.
On Linux, you must be running kernel 2.6.X or later, and glibc 2.5.X or later. That covers the vast majority of installed systems at present. On Mac OS X you must be running 10.7.x or later.

For details of which distributions the current release (valgrind-3.10.0) builds and runs its regression tests on, see the release notes.
[링크 : http://valgrind.org/info/platforms.html

'프로그램 사용 > valgrind' 카테고리의 다른 글

valgrind callgrind  (0) 2023.07.07
valgrind 누수 종류  (0) 2022.01.18
vaglind 사용  (0) 2022.01.14
valgrind GUI frontend- kcachegrind / valkyrie  (0) 2014.10.15
Posted by 구차니
프로그램 사용/valgrind2014. 10. 15. 17:25
valgrind에서 cache 로그를 분석하기 위한 GUI front-end로 kcachegrind가 있고
valgind log를 XML로 출력해서 분석하기 위한 valkyrie가 존재하는데.

valkyrie는 Ubuntu 10.04에서는 1.4.0 이기에
해당 valgrind 버전은 3.3.x 대의 XML 파일이 나와야 한다 -_-a
(문제는 3.3.x를 받아서 arm용으로 크로스 컴파일 하려니 지원하지 않는다는 점..
configure를 뒤져보니 x86 / powerpc 정도만 지원하는 것으로 보인다)

일단 둘다 QT를 지원해야 한다

[링크 : http://kcachegrind.sourceforge.net/] cachegrind 로그 뷰어
[링크 : http://www.open-works.net/projects/valkyrie.html] valkyrie (XML 파일 뷰어)



+
alleyoop 이라는 녀석도 우분투에서 패키지로 지원하나.. 10.04에서는 역시 구버전만.. 

'프로그램 사용 > valgrind' 카테고리의 다른 글

valgrind callgrind  (0) 2023.07.07
valgrind 누수 종류  (0) 2022.01.18
vaglind 사용  (0) 2022.01.14
valgrind 지원 플랫폼  (0) 2014.10.15
Posted by 구차니