mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 11:07:45 +00:00
Profiler: Make everything east-const :^)
This commit is contained in:
parent
cf8427b7b4
commit
ddccf451a9
16 changed files with 68 additions and 68 deletions
|
@ -46,7 +46,7 @@ static bool generate_profile(pid_t& pid);
|
|||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
int pid = 0;
|
||||
const char* perfcore_file_arg = nullptr;
|
||||
char const* perfcore_file_arg = nullptr;
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_option(pid, "PID to profile", "pid", 'p', "PID");
|
||||
args_parser.add_positional_argument(perfcore_file_arg, "Path of perfcore file", "perfcore-file", Core::ArgsParser::Required::No);
|
||||
|
@ -190,7 +190,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto individual_sample_view = TRY(samples_splitter->try_add<GUI::TableView>());
|
||||
samples_table_view->on_selection_change = [&] {
|
||||
const auto& index = samples_table_view->selection().first();
|
||||
auto const& index = samples_table_view->selection().first();
|
||||
auto model = IndividualSampleModel::create(*profile, index.data(GUI::ModelRole::Custom).to_integer<size_t>());
|
||||
individual_sample_view->set_model(move(model));
|
||||
};
|
||||
|
@ -205,7 +205,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto individual_signpost_view = TRY(signposts_splitter->try_add<GUI::TableView>());
|
||||
signposts_table_view->on_selection_change = [&] {
|
||||
const auto& index = signposts_table_view->selection().first();
|
||||
auto const& index = signposts_table_view->selection().first();
|
||||
auto model = IndividualSampleModel::create(*profile, index.data(GUI::ModelRole::Custom).to_integer<size_t>());
|
||||
individual_signpost_view->set_model(move(model));
|
||||
};
|
||||
|
@ -216,9 +216,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto flamegraph_view = TRY(flamegraph_tab->try_add<FlameGraphView>(profile->model(), ProfileModel::Column::StackFrame, ProfileModel::Column::SampleCount));
|
||||
|
||||
const u64 start_of_trace = profile->first_timestamp();
|
||||
const u64 end_of_trace = start_of_trace + profile->length_in_ms();
|
||||
const auto clamp_timestamp = [start_of_trace, end_of_trace](u64 timestamp) -> u64 {
|
||||
u64 const start_of_trace = profile->first_timestamp();
|
||||
u64 const end_of_trace = start_of_trace + profile->length_in_ms();
|
||||
auto const clamp_timestamp = [start_of_trace, end_of_trace](u64 timestamp) -> u64 {
|
||||
return min(end_of_trace, max(timestamp, start_of_trace));
|
||||
};
|
||||
|
||||
|
@ -291,7 +291,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
return app->exec();
|
||||
}
|
||||
|
||||
static bool prompt_to_stop_profiling(pid_t pid, const String& process_name)
|
||||
static bool prompt_to_stop_profiling(pid_t pid, String const& process_name)
|
||||
{
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title(String::formatted("Profiling {}({})", process_name, pid));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue