-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core/profiler): add natives exposing start/stop recording
- currently trying to do recordings can only be done via console commands, which can be tedious - adds `PROFILER_START_RECORDING` and `PROFILER_STOP_RECORDING` to allow automating profiler captures - adds `PROFILER_SAVE_TO_JSON` and `PROFILER_SAVE_TO_MSGPACK` to allow for automated saving of profiler recordings
- Loading branch information
1 parent
49406c4
commit 6dad489
Showing
5 changed files
with
213 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
ns: CFX | ||
apiset: shared | ||
--- | ||
## PROFILER_SAVE_TO_JSON | ||
|
||
```c | ||
void PROFILER_SAVE_TO_JSON(char* fileName); | ||
``` | ||
Saves the current profile in JSON format | ||
On the server `fileName` will be the absolute path of where to save the profiler record to, like `C:\FiveM_Profilers` | ||
On the client `fileName` will be the path relative to the `citizen/profiler` folder, by default this is `%localappdata%/FiveM/FiveM.app/citizen/profiler` | ||
## Parameters | ||
* **fileName**: The file name to save to, this should include the file extension, please see notes above. |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
ns: CFX | ||
apiset: shared | ||
--- | ||
## PROFILER_SAVE_TO_MSGPACK | ||
|
||
```c | ||
void PROFILER_SAVE_TO_MSGPACK(char* fileName); | ||
``` | ||
Saves the current profile in message pack format | ||
On the server `fileName` will be the absolute path of where to save the profiler record to, like `C:\FiveM_Profilers` | ||
On the client `fileName` will be the path relative to the `citizen/profiler` folder, by default this is `%localappdata%/FiveM/FiveM.app/citizen/profiler` | ||
## Parameters | ||
* **fileName**: The file name to save to, this should include file extensions, please see notes above. |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
ns: CFX | ||
apiset: shared | ||
--- | ||
## PROFILER_START_RECORDING | ||
|
||
```c | ||
void PROFILER_START_RECORDING(int frames, char* resourceName); | ||
``` | ||
Starts recording on the profiler. | ||
## Parameters | ||
* **frames**: The amount of frames to record for, -1 to record until calling [PROFILER_STOP_RECORDING](#_0x2d29dea5) | ||
* **resourceName**: The resource to record for, or null to record every resource. |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
ns: CFX | ||
apiset: shared | ||
--- | ||
## PROFILER_STOP_RECORDING | ||
|
||
```c | ||
void PROFILER_STOP_RECORDING(); | ||
``` | ||
|
||
Stops the profiler if its currently recording. |