mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 01:11:15 -03:00
Partially rework profiling. Fix profiling crash with new parser. Fixes
1295
This commit is contained in:
33
parser.h
33
parser.h
@@ -247,25 +247,19 @@ enum parser_type_t
|
||||
|
||||
struct profile_item_t
|
||||
{
|
||||
/**
|
||||
Time spent executing the specified command, including parse time for nested blocks.
|
||||
*/
|
||||
/** Time spent executing the specified command, including parse time for nested blocks. */
|
||||
int exec;
|
||||
/**
|
||||
Time spent parsing the specified command, including execution time for command substitutions.
|
||||
*/
|
||||
|
||||
/** Time spent parsing the specified command, including execution time for command substitutions. */
|
||||
int parse;
|
||||
/**
|
||||
The block level of the specified command. nested blocks and command substitutions both increase the block level.
|
||||
*/
|
||||
|
||||
/** The block level of the specified command. nested blocks and command substitutions both increase the block level. */
|
||||
size_t level;
|
||||
/**
|
||||
If the execution of this command was skipped.
|
||||
*/
|
||||
int skipped;
|
||||
/**
|
||||
The command string.
|
||||
*/
|
||||
|
||||
/** If the execution of this command was skipped. */
|
||||
bool skipped;
|
||||
|
||||
/** The command string. */
|
||||
wcstring cmd;
|
||||
};
|
||||
|
||||
@@ -477,6 +471,9 @@ class parser_t
|
||||
|
||||
/** Returns the job with the given pid */
|
||||
job_t *job_get_from_pid(int pid);
|
||||
|
||||
/* Returns a new profile item if profiling is active. The caller should fill it in. The parser_t will clean it up. */
|
||||
profile_item_t *create_profile_item();
|
||||
|
||||
/**
|
||||
Test if the specified string can be parsed, or if more bytes need
|
||||
@@ -517,9 +514,9 @@ class parser_t
|
||||
void init();
|
||||
|
||||
/**
|
||||
Destroy static parser data
|
||||
Output profiling data to the given filename
|
||||
*/
|
||||
void destroy();
|
||||
void emit_profiling(const char *path) const;
|
||||
|
||||
/**
|
||||
This function checks if the specified string is a help option.
|
||||
|
||||
Reference in New Issue
Block a user