-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(profiler): prepare for flipper plugin publish (#42)
* fix(profiler): ensure atrace can get restarted Since the Flipper plugin starts/stops the ATrace process, we need to ensure that when restarting it, atrace gets restarted ensureCppProfilerIsInstalled is responsible for that but is basing itself on the atraceProcess being null or not * fix(profiler): ensure profiler can be initialized programatically Since getCpuClockTick and getRAMPageSize were previously called at the root, just importing the package and running commands would automatically install the cpp profiler (which is a task taking a few seconds) Several issues with that: - loading Flipper would load the Flipper plugin and try to install the c++ profiler which impacts Flipper load time a lot - since atrace would be started when loading the Flipper plugin, the buffer would already be filled with lots of data when actually starting measures - just less flexibility in general as we will see in the next commit * style(profiler): remove unnecessary require * test: add test for killing atrace
- Loading branch information
Showing
7 changed files
with
53 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
3 changes: 1 addition & 2 deletions
3
packages/android-performance-profiler/src/commands/ram/pollRamUsage.ts
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import { getRAMPageSize } from "../cppProfiler"; | ||
|
||
const BYTES_PER_MB = 1024 * 1024; | ||
const RAM_PAGE_SIZE = getRAMPageSize(); | ||
|
||
export const getCommand = (pid: string) => `cat /proc/${pid}/statm`; | ||
|
||
export const processOutput = (result: string) => { | ||
return (parseInt(result.split(" ")[1], 10) * RAM_PAGE_SIZE) / BYTES_PER_MB; | ||
return (parseInt(result.split(" ")[1], 10) * getRAMPageSize()) / BYTES_PER_MB; | ||
}; |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters