does not work:
amplxe-cl -verbose -collect locksandwaits -duration 30 -target-pid 5541
Ends with the following
Error: Error 0x4000001d (Cannot find raw collector data) -- Cannot re-finalize the result: it has no raw collector data.
amplxe-cl -verbose -collect lightweight-hotspots -duration 30 -target-pid 5541
Because user-mode sampling will doinstrumentation of the target process dynamically- and your service application may work on system mode, which will cause unexpected results.
But for hardware event-based, data collector works in system mode, should have no this issue; User-mode sampling with attach-to-process should work with general applications - they are user mode applications.
The reason is that daemon code possibly be usedby many processes -it doesn't make sense to instrument them at runtime.
You solved a "privilege" issue if you used "root" user, amplxe-cl will tryto instrument running process in ring0.If log on a regular user, amplxe-cl cannot instrument the process in ring0, only caninstrument ring3 application- However ifring0 processis shared (used) bymultiple applications, it will cause unexpectedresult, e.g. abnormally exit.