diff --git a/docs/Commands.md b/docs/Commands.md index 0db3c948..770d8d1b 100644 --- a/docs/Commands.md +++ b/docs/Commands.md @@ -19,7 +19,7 @@ Options: The name of the profiled service. Profiles are grouped by service. -E,--environment TEXT (Env:DD_ENV) The name of the environment to use in the Datadog UI. - -V,--service_version TEXT (Env:DD_VERSION) + -V,--service_version,--service-version TEXT (Env:DD_VERSION) Version of the service being profiled. -U,--url TEXT (Env:DD_TRACE_AGENT_URL) A : URL. Either :, http://: @@ -44,14 +44,14 @@ Profiling settings: -g,--global Excludes: command_line --pid Instrument all processes. Requires specific capabilities or a perf_event_paranoid value of less than 1. - -I,--inlined_functions BOOLEAN [0] + -I,--inlined_functions,--inlined-functions BOOLEAN [0] Report inlined functions in call stacks. This is possible if debug sections are available. This can have performance impacts for the profiler. -t,--timeline (Env:DD_PROFILING_TIMELINE_ENABLE) Enables Timeline view in the Datadog UI. Works by adding timestmaps to certain events. - -u,--upload_period UINT [59] (Env:DD_PROFILING_UPLOAD_PERIOD) + -u,--upload_period,--upload-period UINT [59] (Env:DD_PROFILING_UPLOAD_PERIOD) Upload period for profiles (in seconds). -e,--event TEXT ... (Env:DD_PROFILING_NATIVE_EVENTS) @@ -67,7 +67,8 @@ Profiling settings: Advanced settings: - --switch_user TEXT Run my application with a different user. + --switch_user,--switch-user TEXT + Run my application with a different user. --nice INT Niceness (priority of process) for the profiler. Higher value means nicer (lower priority). @@ -77,15 +78,17 @@ Advanced settings: Debug options: - -l,--log_level TEXT:{debug,informational,notice,warn,error} [error] (Env:DD_PROFILING_NATIVE_LOG_LEVEL) + -l,--log_level,--log-level TEXT:{debug,informational,notice,warn,error} [error] (Env:DD_PROFILING_NATIVE_LOG_LEVEL) One of debug, informational, notice, warn, error. - -o,--log_mode TEXT [stdout] (Env:DD_PROFILING_NATIVE_LOG_MODE) - log_level, One of stdout, stderr, syslog, or disabled. - --show_config [0] Display the configuration. - -b,--internal_stats TEXT (Env:DD_PROFILING_INTERNAL_STATS) + -o,--log_mode,--log-mode TEXT [stdout] (Env:DD_PROFILING_NATIVE_LOG_MODE) + One of stdout, stderr, syslog, or disabled. + --show_config,--show-config [0] + Display the configuration. + -b,--internal_stats,--internal-stats TEXT (Env:DD_PROFILING_INTERNAL_STATS) Enables statsd metrics for ddprof. Value should point to a statsd socket. Example: /var/run/datadog-agent/statsd.sock - --show_samples Display captured samples as logs. + --show_samples,--show-samples + Display captured samples as logs. -v,--version Display the profiler's version. @@ -93,7 +96,8 @@ Debug options: Option to disable the profiler. The profiler then acts as a passthrough. - --capture_config TEXT Capture the current configuration to a file. + --capture_config,--capture-config TEXT + Capture the current configuration to a file. You can then give this configuration through --config. diff --git a/src/ddprof_cli.cc b/src/ddprof_cli.cc index cb1dd2ea..af2838ad 100644 --- a/src/ddprof_cli.cc +++ b/src/ddprof_cli.cc @@ -123,7 +123,8 @@ int DDProfCLI::parse(int argc, const char *argv[]) { "The name of the environment to use in the Datadog UI.") ->envname("DD_ENV"); - app.add_option("--service_version,-V", exporter_input.service_version, + app.add_option("--service_version,--service-version,-V", + exporter_input.service_version, "Version of the service being profiled.") ->envname("DD_VERSION"); @@ -163,7 +164,8 @@ int DDProfCLI::parse(int argc, const char *argv[]) { ->group("Profiling settings") ->excludes(pid_opt) ->excludes(exec_option); - app.add_option("--inlined_functions,-I", inlined_functions, + app.add_option("--inlined_functions,--inlined-functions,-I", + inlined_functions, "Report inlined functions in call stacks.\n" "This is possible if debug sections are available.\n" "This can have performance impacts for the profiler.") @@ -176,7 +178,7 @@ int DDProfCLI::parse(int argc, const char *argv[]) { ->envname("DD_PROFILING_TIMELINE_ENABLE"); app.add_option( - "--upload_period,-u", upload_period, + "--upload_period,--upload-period,-u", upload_period, "Upload period for profiles (in seconds).\n") ->default_val( static_cast(k_default_upload_period).count()) @@ -204,7 +206,7 @@ int DDProfCLI::parse(int argc, const char *argv[]) { ->envname("DD_PROFILING_NATIVE_PRESET"); // Advanced settings - app.add_option("--switch_user", switch_user, + app.add_option("--switch_user,--switch-user", switch_user, "Run my application with a different user.\n") ->group("Advanced settings"); app.add_option("--nice", nice, @@ -219,7 +221,7 @@ int DDProfCLI::parse(int argc, const char *argv[]) { ->group("Advanced settings"); // Debug - app.add_option("--log_level,-l", log_level, + app.add_option("--log_level,--log-level,-l", log_level, "One of debug, informational, notice, warn, error.") ->default_val("error") ->check( @@ -227,24 +229,25 @@ int DDProfCLI::parse(int argc, const char *argv[]) { ->group("Debug options") ->envname("DD_PROFILING_NATIVE_LOG_LEVEL"); // - app.add_option("--log_mode,-o", log_mode, - "log_level, One of stdout, stderr, syslog, or disabled.") + app.add_option("--log_mode,--log-mode,-o", log_mode, + "One of stdout, stderr, syslog, or disabled.") ->default_val("stdout") ->group("Debug options") ->envname("DD_PROFILING_NATIVE_LOG_MODE"); // - app.add_flag("--show_config", show_config, "Display the configuration.") + app.add_flag("--show_config,--show-config", show_config, + "Display the configuration.") ->default_val(false) ->group("Debug options"); // - app.add_option("--internal_stats,-b", internal_stats, + app.add_option("--internal_stats,--internal-stats,-b", internal_stats, "Enables statsd metrics for " MYNAME ". Value should point " "to a statsd socket.\n" "Example: /var/run/datadog-agent/statsd.sock") ->group("Debug options") ->envname("DD_PROFILING_INTERNAL_STATS"); - app.add_flag("--show_samples", show_samples, + app.add_flag("--show_samples,--show-samples", show_samples, "Display captured samples as logs.\n") ->group("Debug options"); app.add_flag("--version,-v", version, "Display the profiler's version.\n") @@ -255,7 +258,7 @@ int DDProfCLI::parse(int argc, const char *argv[]) { ->default_val(true) ->envname("DD_PROFILING_ENABLED") ->group("Debug options"); - app.add_option("--capture_config", capture_config, + app.add_option("--capture_config,--capture-config", capture_config, "Capture the current configuration to a file.\n" "You can then give this configuration through --config.\n") ->group("Debug options"); @@ -264,31 +267,32 @@ int DDProfCLI::parse(int argc, const char *argv[]) { std::vector extended_options; extended_options.push_back( app.add_option( - "--worker_period", worker_period, + "--worker_period,--worker-period", worker_period, "Period at which the profiler resets it's internal state.\n" "The unit is the number of exports (so default is ~4 hours)") ->default_val(k_default_worker_period) ->group("")); extended_options.push_back( - app.add_option("--api_key", exporter_input.api_key, + app.add_option("--api_key,--api-key", exporter_input.api_key, "A debug option to work without the Datadog agent.\n") ->group("") ->envname("DD_API_KEY")); extended_options.push_back( - app.add_option("--cpu_affinity", cpu_affinity, + app.add_option("--cpu_affinity,--cpu-affinity", cpu_affinity, "Hexadecimal value of the cpu affinity" " eg: 0xa4") ->group("")); extended_options.push_back( - app.add_option("--do_export", exporter_input.do_export, + app.add_option("--do_export,--do-export", exporter_input.do_export, "Debug flag to prevent exporting the profiles") ->default_val(true) ->group("")); extended_options.push_back( - app.add_option("--debug_pprof_prefix", exporter_input.debug_pprof_prefix, + app.add_option("--debug_pprof_prefix,--debug-pprof-prefix", + exporter_input.debug_pprof_prefix, "Prefix path to capture pprof files locally") ->group("") ->envname("DD_PROFILING_PPROF_PREFIX")); @@ -296,13 +300,15 @@ int DDProfCLI::parse(int argc, const char *argv[]) { app.add_option("--agentless", exporter_input.agentless, "Allow sending profiles directly to Datadog intake") ->group("")); - extended_options.push_back( - app.add_option("--fault_info", fault_info, "Log segfault information") - ->default_val(true) - ->group("")); - extended_options.push_back( - app.add_flag("--help_extended", help_extended, "Show extended options") - ->group("")); + extended_options.push_back(app.add_option("--fault_info,--fault-info", + fault_info, + "Log segfault information") + ->default_val(true) + ->group("")); + extended_options.push_back(app.add_flag("--help_extended,--help-extended", + help_extended, + "Show extended options") + ->group("")); extended_options.push_back( app.add_option( "--socket", socket_path, @@ -315,7 +321,8 @@ int DDProfCLI::parse(int argc, const char *argv[]) { "spawned the profiler") ->group("")); extended_options.push_back( - app.add_option("--stack_sample_size", default_stack_sample_size, + app.add_option("--stack_sample_size,--stack-sample-size", + default_stack_sample_size, "Sample size for the user's stack." "This setting can help with truncated stack traces." "Maximum value is 65528 (check(SampleStackSizeValidator())); extended_options.push_back( app.add_option( - "--initial-loaded-libs-check-delay", + "--initial-loaded-libs-check-delay,--initial_loaded_libs_check_" + "delay", initial_loaded_libs_check_delay, "Initial delay (ms) before check for newly loaded libs.") ->default_val(static_cast( @@ -336,7 +344,8 @@ int DDProfCLI::parse(int argc, const char *argv[]) { ->group("")); extended_options.push_back( app.add_option( - "--loaded-libs-check-interval", loaded_libs_check_interval, + "--loaded-libs-check-interval,--loaded_libs_check_interval", + loaded_libs_check_interval, "Interval (ms) between checks for newly loaded libs.") ->default_val(static_cast( k_default_loaded_libs_check_interval) @@ -345,19 +354,19 @@ int DDProfCLI::parse(int argc, const char *argv[]) { ->envname("DD_PROFILING_LOADED_LIBS_CHECK_INTERVAL") ->group("")); - extended_options.push_back(app.add_flag("--remote-symbolization", - remote_symbolization, - "Enable remote symbolization") - ->default_val(false) - ->envname("DD_PROFILING_REMOTE_SYMBOLIZATION") - ->group("")); + extended_options.push_back( + app.add_flag("--remote-symbolization,--remote_symbolization", + remote_symbolization, "Enable remote symbolization") + ->default_val(false) + ->envname("DD_PROFILING_REMOTE_SYMBOLIZATION") + ->group("")); - extended_options.push_back(app.add_flag("--disable-symbolization", - disable_symbolization, - "Disable symbolization") - ->default_val(false) - ->envname("DD_PROFILING_DISABLE_SYMBOLIZATION") - ->group("")); + extended_options.push_back( + app.add_flag("--disable-symbolization,--disable_symbolization", + disable_symbolization, "Disable symbolization") + ->default_val(false) + ->envname("DD_PROFILING_DISABLE_SYMBOLIZATION") + ->group("")); extended_options.push_back( app.add_flag("--reorder-events,!--no-reorder-events", reorder_events,