google / UIforETW

User interface for recording and managing ETW traces
https://randomascii.wordpress.com/2015/04/14/uiforetw-windows-performance-made-easier/
Apache License 2.0
1.55k stars 201 forks source link

Feature Request for Remote start/stop #146

Closed thetasine closed 3 years ago

thetasine commented 3 years ago

I don't know if this has been requested before, but I could not find this feature on your blog nor the release notes.

My feature request is some facility to remotely signal when to start and stop a trace. My goal is to use Powershell to send a command to the app to start tracing based on text input from a log file, and then stop when receiving a different text input.

Basically I'm trying to narrow down some file-system issues for a long running process (24-48 hours) which logging specifically has start and end tags for the file system access tasks. The logs are located on a different machine though, thus my need to do this remotely on the logging machine as scripting is a lot easier. I could hack together an "Invoke-Command" in Powershell to run xperf myself, but then I miss out on your utilities advantages over it. It also requires a lot of setup to get it working.

Basically any type of signal would work, so long as I can send it via Powershell on a remote machine to the UIforETW endpoint. CIM, WMI, HTTP, I really don't have a preference.

As an example, let's say you added a REST endpoint to the utility. We setup the utility, and then enable remote start/stop in the preferences on port 9100. We could then do this in Powershell on the remote machine:

Get-Content -Path some.log -Tail 1 -Wait | % {switch -regex ($_) { '[StartTag]' { Invoke-RestMethod http://machine:9100/start } '[EndTag]' { Invoke-RestMethod http://machine:9100/stop }
}}

I know this would be a major addition to the application, so if this is not on your list of things to do, I understand. It would be supremely helpful though! I humbly submit this as a good addition.

Thank you for your excellent utility!

randomascii commented 3 years ago

I think this is a good idea. It would make me a bit nervous to have UIforETW, as an elevated process, talking over the network so it would be nice to get https://github.com/google/UIforETW/issues/135 fixed first.

And, while I think this would be a good idea (it adds a lot of flexibility) I don't think I am likely to implement. So, pull requests welcome as they say.

An alternative which I have done in the past is to customize UIforETW to contain the logic directly. As in, build it from source with whatever monitoring you want, using a local branch.

thetasine commented 3 years ago

I think this is a good idea. It would make me a bit nervous to have UIforETW, as an elevated process, talking over the network so it would be nice to get #135 fixed first.

Understood!

And, while I think this would be a good idea (it adds a lot of flexibility) I don't think I am likely to implement. So, pull requests welcome as they say.

Understood as well.

An alternative which I have done in the past is to customize UIforETW to contain the logic directly. As in, build it from source with whatever monitoring you want, using a local branch.

Thanks for the info. I appreciate you addressing my request. I will close this issue.