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

help: improve feature descriptions #202

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

JakeHillion
Copy link
Contributor

Summary

Features previously had no descriptions and were all crammed onto one line. Improve the help of OID and OITB to make it clearer what each feature does.

This isn't ideal formatting but it's definitely better than what was there before. I might clean this up more at some point.

Test plan

Before:

$ make oid && build/oid --help
usage: oid ...
  -h,--help                      Print this message and exit
  -p,--pid <pid>                 Target process to attach to
  -c,--config-file               </path/to/oid.toml>
  -x,--data-buf-size <bytes>     Size of data segment (default:1MB)
                                 Accepts multiplicative suffix: K, M, G, T, P, E
  -d,--debug-level <level>       Verbose level for logging
  -r,--remove-mappings           Remove oid mappings from target process
  -s,--script                    </path/to/script.oid>
  -S,--script-source             type:symbol:arg
  -t,--timeout <seconds>         How long to probe the target process for
  -k,--custom-code-file          </path/to/code.cpp>
                                 Use your own CPP file instead of CodeGen
  -e,--compile-and-exit          Compile only then exit
  -o,--cache-path <path>         Enable caching using the provided directory
  -u,--cache-remote              Enable upload/download of cache files
                                 Pick from {both,upload,download}
  -i,--debug-path                </path/to/binary>
                                 Run oid on a executable with debug infos instead of a running process
  -J,--dump-json [oid_out.json]  File to dump the results to, as JSON
                                 (in addition to the default RocksDB output)
  -B,--dump-data-segment         Dump the data segment's content, before TreeBuilder processes it
                                 Each argument gets its own dump file: 'dataseg.<oid-pid>.<arg>.dump'
  -a,--log-all-structs           Log all structures
  -m,--mode [prod]               Allows to specify a mode of operation/group of settings
  -f,--enable-feature            Enable a specific feature: [chase-raw-pointers,pack-structs,gen-padding-stats,capture-thrift-isset,type-graph,typed-data-segment,gen-jit-debug,jit-logging,polymorphic-inheritance,]
  -F,--disable-feature           Disable a specific feature: [chase-raw-pointers,pack-structs,gen-padding-stats,capture-thrift-isset,type-graph,typed-data-segment,gen-jit-debug,jit-logging,polymorphic-inheritance,]

        For problem reporting, questions and general comments please pop along
        to the Object Introspection Workplace group at https://fburl.com/oid.

After:

$ make oid && build/oid --help
usage: oid ...
  -h,--help                      Print this message and exit
  -p,--pid <pid>                 Target process to attach to
  -c,--config-file               </path/to/oid.toml>
  -x,--data-buf-size <bytes>     Size of data segment (default:1MB)
                                 Accepts multiplicative suffix: K, M, G, T, P, E
  -d,--debug-level <level>       Verbose level for logging
  -r,--remove-mappings           Remove oid mappings from target process
  -s,--script                    </path/to/script.oid>
  -S,--script-source             type:symbol:arg
  -t,--timeout <seconds>         How long to probe the target process for
  -k,--custom-code-file          </path/to/code.cpp>
                                 Use your own CPP file instead of CodeGen
  -e,--compile-and-exit          Compile only then exit
  -o,--cache-path <path>         Enable caching using the provided directory
  -u,--cache-remote              Enable upload/download of cache files
                                 Pick from {both,upload,download}
  -i,--debug-path                </path/to/binary>
                                 Run oid on a executable with debug infos instead of a running process
  -J,--dump-json [oid_out.json]  File to dump the results to, as JSON
                                 (in addition to the default RocksDB output)
  -B,--dump-data-segment         Dump the data segment's content, before TreeBuilder processes it
                                 Each argument gets its own dump file: 'dataseg.<oid-pid>.<arg>.dump'
  -a,--log-all-structs           Log all structures
  -m,--mode [prod]               Allows to specify a mode of operation/group of settings
  -f,--enable-feature FEATURE    Enable feature
  -F,--disable-feature FEATURE   Disable feature

FEATURES SUMMARY
  chase-raw-pointers       Chase raw pointers in the probed object.
  pack-structs             Pack structs.
  gen-padding-stats        Generate statistics on padding of structures.
  capture-thrift-isset     Capture isset data for Thrift object.
  type-graph               Use Type Graph for code generation (CodeGen V2).
  typed-data-segment       Use Typed Data Segment in generated code.
  gen-jit-debug            Generate debug information for the JIT object.
  jit-logging              Log information from the JIT code for debugging.
  polymorphic-inheritance  Follow polymorphic inheritance hierarchies in the probed object.

        For problem reporting, questions and general comments please pop along
        to the Object Introspection Workplace group at https://fburl.com/oid.

@tyroguru
Copy link
Contributor

tyroguru commented Jul 3, 2023

Very nice.

@JakeHillion JakeHillion merged commit 3da628b into facebookexperimental:main Jul 3, 2023
@JakeHillion JakeHillion deleted the feature-desc branch July 3, 2023 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants