profile: support for -profile-no-inline (with it, [inline] fns will not get profiled)
parent
847a1035a5
commit
4c320e1512
|
@ -75,6 +75,9 @@ The build flags are shared by the build and run commands:
|
|||
d) the function name
|
||||
NB: if you want to output the profile info to stdout, use `-profile -`.
|
||||
|
||||
-profile-no-inline
|
||||
Skip [inline] functions when profiling.
|
||||
|
||||
-stats
|
||||
Enable more detailed statistics reporting, while compiling test files.
|
||||
You can use that with `v test` too, for example:
|
||||
|
|
|
@ -150,6 +150,9 @@ fn parse_args(args []string) (&pref.Preferences, string) {
|
|||
res.is_prof = true
|
||||
i++
|
||||
}
|
||||
'-profile-no-inline' {
|
||||
res.profile_no_inline = true
|
||||
}
|
||||
'-prod' {
|
||||
res.is_prod = true
|
||||
}
|
||||
|
|
|
@ -12,6 +12,10 @@ fn (mut g Gen) profile_fn(fn_name string, is_main bool){
|
|||
g.writeln('\tatexit(vprint_profile_stats);')
|
||||
g.writeln('')
|
||||
}
|
||||
if g.pref.profile_no_inline && g.attr == 'inline' {
|
||||
g.defer_profile_code = ''
|
||||
return
|
||||
}
|
||||
if fn_name.starts_with('time.vpc_now') {
|
||||
g.defer_profile_code = ''
|
||||
} else {
|
||||
|
|
|
@ -33,6 +33,7 @@ pub mut:
|
|||
is_shared bool // an ordinary shared library, -shared, no matter if it is live or not
|
||||
is_prof bool // benchmark every function
|
||||
profile_file string // the profile results will be stored inside profile_file
|
||||
profile_no_inline bool // when true, [inline] functions would not be profiled
|
||||
translated bool // `v translate doom.v` are we running V code translated from C? allow globals, ++ expressions, etc
|
||||
is_prod bool // use "-O2"
|
||||
obfuscate bool // `v -obf program.v`, renames functions to "f_XXX"
|
||||
|
|
Loading…
Reference in New Issue