Last active
February 18, 2025 15:37
Revisions
-
felipeek revised this gist
Jul 21, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,5 +18,5 @@ Approach 2: run a process with massif, manually decide when the snapshots are ta - 5. Run `continue` or simply `c` to continue execution. - 6. Once a breakpoint hits, type `monitor detailed_snapshot <filename>` to generate a snapshot. Do this for each snapshot you wanna generate. Always use different filenames. - 7. Once you generate your last snapshot, type `monitor all_snapshots <all_snapshots_filename>` to generate a final result, merging all previously-generated snapshots. You just need to specify the name of the final file, all files that were generated previously are automatically tracked. - 8a. Option 1: Run `ms_print <all_snapshots_filename> > user_friendly.txt` to generate a user-friendly file and analyze it. - 8b. Option 2: Run `massif-visualizer <all_snapshots_filename>` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer` -
felipeek revised this gist
Jul 21, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,6 @@ Approach 2: run a process with massif, manually decide when the snapshots are ta - 4. Run `break your_file.c:LINE` to put a breakpoint, e.g. `break my_file.c:193`. Put breakpoints in all places needed since you will only be able to generate snapshots once a breakpoint is hit. - 5. Run `continue` or simply `c` to continue execution. - 6. Once a breakpoint hits, type `monitor detailed_snapshot <filename>` to generate a snapshot. Do this for each snapshot you wanna generate. Always use different filenames. - 7. Once you generate your last snapshot, type `monitor all_snapshots <all_snapshots_filename>` to generate a final result, merging all previously-generated snapshots. You just need to specify the name of the final file, all files that were generated previously are automatically tracked. - 8a. Option 1: Run `ms_print <all_snapshots_filename > user_friendly.txt` to generate a user-friendly file and analyze it. - 8b. Option 2: Run `massif-visualizer <all_snapshots_filename>` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer` -
felipeek revised this gist
Jul 21, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Approach 2: run a process with massif, manually decide when the snapshots are ta - 3. Run `target remote | /usr/bin/vgdb` (NOTE: change `/usr/bin/vgdb` to your vgdb installation, if necessary. You can run `which vgdb` to confirm) - 4. Run `break your_file.c:LINE` to put a breakpoint, e.g. `break my_file.c:193`. Put breakpoints in all places needed since you will only be able to generate snapshots once a breakpoint is hit. - 5. Run `continue` or simply `c` to continue execution. - 6. Once a breakpoint hits, type `monitor detailed_snapshot <filename>` to generate a snapshot. Do this for each snapshot you wanna generate. Always use different filenames. - 7. Once you generate your last snapshot, type `monitor all_snapshots <all_snapshots_filename>` to generate a final result, merging all previously-generated snapshots. - 8a. Option 1: Run `ms_print <all_snapshots_filename > user_friendly.txt` to generate a user-friendly file and analyze it. - 8b. Option 2: Run `massif-visualizer <all_snapshots_filename>` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer` -
felipeek revised this gist
Jul 21, 2022 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,9 @@ Approach 2: run a process with massif, manually decide when the snapshots are ta # Approach 1 - 1. Run your process with massif: `valgrind --tool=massif <your executable> <your process arguments>` - 2. Do whatever you need to do, and then stop your process. A file named ms_print massif.out.*pid* will be generated. - 3a. Option 1: Run `ms_print massif.out.*pid* > user_friendly.txt` to generate a user-friendly file and analyze it. - 3b. Option 2: Run `massif-visualizer massif.out.*pid*` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer` # Approach 2 -
felipeek revised this gist
Jul 21, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,14 +4,14 @@ Approach 2: run a process with massif, manually decide when the snapshots are ta # Approach 1 - 1. Run your process with massif: `valgrind --tool=massif <your executable> <your process arguments>` - 2. Do whatever you need to do, and then stop your process. A file named ms_print massif.out.<pid> will be generated. - 3a. Option 1: Run `ms_print massif.out.<pid> > user_friendly.txt` to generate a user-friendly file and analyze it. - 3b. Option 2: Run `massif-visualizer massif.out.<pid>` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer` # Approach 2 - 1. Run your process with massif: `valgrind --tool=massif --vgdb=yes --vgdb-error=0 <your executable> <your process arguments>` - 2. In another shell, run `gdb <your process>`. The next commands will be all related to this new shell. - 3. Run `target remote | /usr/bin/vgdb` (NOTE: change `/usr/bin/vgdb` to your vgdb installation, if necessary. You can run `which vgdb` to confirm) - 4. Run `break your_file.c:LINE` to put a breakpoint, e.g. `break my_file.c:193`. Put breakpoints in all places needed since you will only be able to generate snapshots once a breakpoint is hit. -
felipeek revised this gist
Jul 21, 2022 . 1 changed file with 13 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,19 +4,19 @@ Approach 2: run a process with massif, manually decide when the snapshots are ta # Approach 1 - 1. Run your process with massif: `valgrind --tool=massif <your process> <your process arguments>` - 2. Do whatever you need to do, and then stop your process. A file named ms_print massif.out.<pid> will be generated. - 3a. Option 1: Run `ms_print massif.out.<pid> > user_friendly.txt` to generate a user-friendly file and analyze it. - 3b. Option 2: Run `massif-visualizer massif.out.<pid>` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer` # Approach 2 - 1. Run your process with massif: `valgrind --tool=massif --vgdb=yes --vgdb-error=0 <your process> <your process arguments>` - 2. In another shell, run `gdb <your process>`. The next commands will be all related to this new shell. - 3. Run `target remote | /usr/bin/vgdb` (NOTE: change `/usr/bin/vgdb` to your vgdb installation, if necessary. You can run `which vgdb` to confirm) - 4. Run `break your_file.c:LINE` to put a breakpoint, e.g. `break my_file.c:193`. Put breakpoints in all places needed since you will only be able to generate snapshots once a breakpoint is hit. - 5. Run `continue` or simply `c` to continue execution. - 6. Once a breakpoint hits, type `monitor detailed_snapshot <filename>` to generate a snapshot. Do this for each snapshot you wanna generate. - 7. Once you generate your last snapshot, type `monitor all_snapshots <all_snapshots_filename>` to generate a final result, merging all previously-generated snapshots. - 8a. Option 1: Run `ms_print <all_snapshots_filename > user_friendly.txt` to generate a user-friendly file and analyze it. - 8b. Option 2: Run `massif-visualizer <all_snapshots_filename>` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer` -
felipeek revised this gist
Jul 21, 2022 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,16 @@ Approach 1: run a process with massif, let it take automatic memory snapshots and then analyze the results Approach 2: run a process with massif, manually decide when the snapshots are taken, and then analyze the results # Approach 1 1. Run your process with massif: `valgrind --tool=massif <your process> <your process arguments>` 2. Do whatever you need to do, and then stop your process. A file named ms_print massif.out.<pid> will be generated. 3a. Option 1: Run `ms_print massif.out.<pid> > user_friendly.txt` to generate a user-friendly file and analyze it. 3b. Option 2: Run `massif-visualizer massif.out.<pid>` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer` # Approach 2 1. Run your process with massif: `valgrind --tool=massif --vgdb=yes --vgdb-error=0 <your process> <your process arguments>` 2. In another shell, run `gdb <your process>`. The next commands will be all related to this new shell. 3. Run `target remote | /usr/bin/vgdb` (NOTE: change `/usr/bin/vgdb` to your vgdb installation, if necessary. You can run `which vgdb` to confirm) -
felipeek renamed this gist
Jul 21, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
felipeek renamed this gist
Jul 21, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
felipeek created this gist
Jul 21, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ Approach 1: run a process with massif, let it take automatic memory snapshots and then analyze the results Approach 2: run a process with massif, manually decide when the snapshots are taken, and then analyze the results Approach 1: 1. Run your process with massif: `valgrind --tool=massif <your process> <your process arguments>` 2. Do whatever you need to do, and then stop your process. A file named ms_print massif.out.<pid> will be generated. 3a. Option 1: Run `ms_print massif.out.<pid> > user_friendly.txt` to generate a user-friendly file and analyze it. 3b. Option 2: Run `massif-visualizer massif.out.<pid>` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer` Approach 2: 1. Run your process with massif: `valgrind --tool=massif --vgdb=yes --vgdb-error=0 <your process> <your process arguments>` 2. In another shell, run `gdb <your process>`. The next commands will be all related to this new shell. 3. Run `target remote | /usr/bin/vgdb` (NOTE: change `/usr/bin/vgdb` to your vgdb installation, if necessary. You can run `which vgdb` to confirm) 4. Run `break your_file.c:LINE` to put a breakpoint, e.g. `break my_file.c:193`. Put breakpoints in all places needed since you will only be able to generate snapshots once a breakpoint is hit. 5. Run `continue` or simply `c` to continue execution. 6. Once a breakpoint hits, type `monitor detailed_snapshot <filename>` to generate a snapshot. Do this for each snapshot you wanna generate. 7. Once you generate your last snapshot, type `monitor all_snapshots <all_snapshots_filename>` to generate a final result, merging all previously-generated snapshots. 8a. Option 1: Run `ms_print <all_snapshots_filename > user_friendly.txt` to generate a user-friendly file and analyze it. 8b. Option 2: Run `massif-visualizer <all_snapshots_filename>` to visualize the results in a pretty UI. You need to install massif-visualizer: `sudo apt install massif-visualizer`