Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you please help with compile under profiler support like gprof #3659

Open
vit1251 opened this issue Jun 1, 2018 · 11 comments · May be fixed by #10642
Open

Could you please help with compile under profiler support like gprof #3659

vit1251 opened this issue Jun 1, 2018 · 11 comments · May be fixed by #10642

Comments

@vit1251
Copy link

vit1251 commented Jun 1, 2018

I create some application and want understand profile information over gprof.
Tight now I add

c_args = [ '-pg' ]
link_args = ['-pg']

As result I receive gmon.out but gprof does not provide any result. Do u know where problem may bey exists?

@vit1251 vit1251 changed the title Could you please help with compile under profiler support like gpref Could you please help with compile under profiler support like gprof Jun 1, 2018
@vit1251
Copy link
Author

vit1251 commented Jun 1, 2018

It look like require

c_args = ['-pg', '-no-pie']
link_args = ['-pg', '-no-pie']

But may be meson contain keyword argument to compile with profiling instead do it by hand?

@jpakkane
Copy link
Member

jpakkane commented Jun 1, 2018

Hmmm, apparently we don't have an option for that. It would be a useful addition, so patches are welcome as usual? In the mean time you might consider using some other profiler, such as the one integrated in Valgrind.

@vit1251
Copy link
Author

vit1251 commented Feb 12, 2019

@jpakkane Valgrind is well working but some very real-time application may degradate performance. I does know about gpref but belive that it less affect my own application performance.

@solsticedhiver
Copy link

solsticedhiver commented Sep 7, 2020

Yes. that would be a welcome feature instead of crawling the web towards that issue

@dwsteele
Copy link

+1 for this feature.

@andy5995
Copy link
Contributor

@jpakkane @eli-schwartz you can assign this to me.

Should profiling be added as an additional value for the 'buildtype' core option?

@eli-schwartz
Copy link
Member

Is it a build type? The current ones map to various debug/optimization settings. This seems more in the same genre as sanitizers, fanalyzer, and so on, so I'd expect it to be a b_profiler option or something.

@dwsteele
Copy link

I prefer b_profile. Working similar to b_coverage.

@andy5995
Copy link
Contributor

andy5995 commented Jul 29, 2022

Is it a build type? The current ones map to various debug/optimization settings. This seems more in the same genre as sanitizers, fanalyzer, and so on, so I'd expect it to be a b_profiler option or something.

In the gcc docs, it's listed under the Instrumentation heading.

I'll start by adding it as a 'b_...' option.

One sticking point.. Besides -pg, there's also a -p option (gcc compiler).

Generate extra code to write profile information suitable for the analysis program prof (for -p) or gprof (for -pg).

So do we need a b_profile option and also a b_gprofile option?

@eli-schwartz
Copy link
Member

One option, but it accepts 3 choices (similar to how optimization accepts several choices depending on what kind of optimization you want).

andy5995 added a commit to andy5995/meson that referenced this issue Jul 29, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Jul 29, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Jul 29, 2022
@andy5995 andy5995 linked a pull request Jul 29, 2022 that will close this issue
@andy5995
Copy link
Contributor

Do we actually need to add an option for 'prof'? I can't even find that program in Arch Linux or Debian.

andy5995 added a commit to andy5995/meson that referenced this issue Jul 29, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Jul 29, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Jul 29, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Jul 29, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Jul 30, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 10, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 10, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 10, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 11, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 11, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 11, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 23, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 23, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 23, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 23, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Aug 24, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Sep 3, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Sep 29, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Sep 29, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Oct 6, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Dec 28, 2022
andy5995 added a commit to andy5995/meson that referenced this issue Feb 22, 2023
andy5995 added a commit to andy5995/meson that referenced this issue Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants