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

Feature request: Support multiple headless queries #35

Open
eclipsewebmaster opened this issue May 8, 2024 · 2 comments
Open

Feature request: Support multiple headless queries #35

eclipsewebmaster opened this issue May 8, 2024 · 2 comments

Comments

@eclipsewebmaster
Copy link

| --- | --- |
| Bugzilla Link | 573591 |
| Status | NEW |
| Importance | P3 enhancement |
| Reported | May 17, 2021 15:29 EDT |
| Modified | Apr 29, 2022 10:41 EDT |
| Reporter | Kevin Grigorenko |

Description

It doesn't seem that more than one query can be run in headless mode. For example:

./mat.app/Contents/MacOS/MemoryAnalyzer -consoleLog -nosplash -application org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -command=thread_overview org.eclipse.mat.api:query -vmargs -Xmx4g

@eclipsewebmaster
Copy link
Author

By Andrew Johnson on May 28, 2021 03:55

You can run more than one report, but the options and report specifications are collected together, so the second command setting will overwrite the first.

See org.eclipse.mat.internal.apps.ParseSnapshotApp

It gets tricky to see how to do what you want in a compatible fashion.

  1. Only take options up to the reports.
    • breaks people who specify options after the reports
  2. Also add options if they are the last on the line (no more report)
    • complicated to explain
  3. If an option is redefined, run the reports and options specified so far before continuing
    • complicated
      Consider
      MemoryAnalyzer org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -format=txt -command=thread_overview org.eclipse.mat.api:query
      The -format=txt would also apply to the histogram
  4. If an option is redefined, run the reports and options specified up to the last report before continuing
    Consider
    MemoryAnalyzer org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -format=txt -format-csv
    MemoryAnalyzer org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -format=txt -format-csv org.eclipse.api:leak_suspects
  5. Have an argument which means process everything up to this point
    E.g.
    MemoryAnalyzer -consoleLog -nosplash -application org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -: -command=thread_overview org.eclipse.mat.api:query
    Semicolon is bad as it needs to be escaped on Linux
  6. Write your own report with a different option, say command2
  7. Run two separate commands - HPROF parser is pretty quick at reloading

Is there any Linux / Unix command that behaves like any of these. E.g. can you run a C compiler with one command on two files, defining the same macro from the command line differently for both?

@eclipsewebmaster
Copy link
Author

By Kevin Grigorenko on Jun 01, 2021 12:45

Hey Andrew,
Good point that we don't want to break existing users/scripts.
I'm not aware of any command line programs with this sort of use case.
I like option 5.
Option 6 is a good workaround.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant