Skip to content

flang: instrument function flags missing with misleading error #112330

Closed
@Thyre

Description

@Thyre

Some tools, for example performance tools, use instrument function flags to get information about called functions in a user code. This feature is supported in Clang for quite some time. Almost every compiler has some flag for this. In Score-P, we check for some of them, together with other instrumentation methods like compiler plug-ins (see here).

However, as far as I'm aware of flang / flang-new does not support these flags. Using a very basic test file, these are the results I'm getting when trying function instrumentation:

$ cat test.f90
program main

end program main
$ flang --version
flang version 20.0.0git (https://github.com/llvm/llvm-project.git 77f8297c6fdaa62121ddb108043dcaad5c45c7ad)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/apps/software/Clang/trunk/bin
Build config: +assertions
$ flang -finstrument-functions test.f90
flang-20: error: unknown argument '-finstrument-functions'; did you mean '-Xclang -finstrument-functions'?
$ flang -Xclang -finstrument-functions test.f90
flang-20: error: unknown argument '-Xclang'; did you mean '-Xflang'?
flang-20: error: unknown argument '-finstrument-functions'; did you mean '-Xclang -finstrument-functions'?
$ flang -Xflang -finstrument-functions test.f90
error: unknown argument: '-finstrument-functions'

The basic error message leads the user to another flag which doesn't actually work (-Xclang). This should probably be fixed.

Is there any other instrumentation flag I'm missing here? I ran into this issue because someone wanted to build Score-P without our LLVM plug-in and still wanted to have function instrumentation. The old flang used cyg_profile_func via -g -Mx,129,0x800, but this flag also doesn't work.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions