pub struct CtprofCompareArgs {Show 13 fields
pub baseline: PathBuf,
pub candidate: PathBuf,
pub group_by: GroupBy,
pub cgroup_flatten: Vec<String>,
pub no_thread_normalize: bool,
pub no_cg_normalize: bool,
pub sort_by: String,
pub display_format: DisplayFormat,
pub columns: String,
pub sections: String,
pub metrics: String,
pub wrap: bool,
pub limit: usize,
}Expand description
Arguments for the ktstr ctprof compare subcommand.
Fields§
§baseline: PathBufBaseline snapshot (.ctprof.zst) from ktstr ctprof capture -o.
candidate: PathBufCandidate snapshot (.ctprof.zst) from ktstr ctprof capture -o.
group_by: GroupByGrouping key. pcomm aggregates per process
name with token-based pattern normalization (so
worker-{0..N} parent processes cluster into one
worker-{N} bucket); cgroup per cgroup path; comm
aggregates threads by NAME PATTERN under the same
token-based normalizer (digits, hex,
alpha-prefix-digits collapse into placeholders so
tokio-worker-{0..N} and kworker/u8:7 cluster); use
--no-thread-normalize to disable that collapse and group
by literal comm / pcomm instead. comm-exact
disables thread-axis normalization only — its smaps keys
stay pcomm-pattern normalized — unlike comm --no-thread-normalize, which also keys smaps literally
per-PID; see GroupBy::CommExact.
Under all (default): also activates fudging — pairs
of cgroups with renamed-but-identical thread populations
(Jaccard similarity ≥ 0.90 over (pcomm, comm) thread
types, both sides ≥ 10 distinct types) are joined for
diffing instead of surfacing as orphans. Fudged rows
render with a [fudged: <leaf>] marker; the
## Fudged cgroup matches section at the bottom of the
output details the matched pairs and their
jaccard / overlap / cascade roots / residuals.
cgroup_flatten: Vec<String>Glob patterns that collapse dynamic cgroup path segments
so structurally-equivalent cgroups across runs group
together. Example:
--cgroup-flatten '/kubepods/*/workload' treats different
pod IDs as the same group. Repeatable. Independent of
--no-cg-normalize: explicit globs apply first, then
auto-normalize runs unless disabled.
no_thread_normalize: boolDisable token-based pattern normalization across every
name-family axis: --group-by comm, --group-by pcomm,
AND the ## smaps_rollup per-process keying (which
normalizes by the pcomm pattern by default — see
collect_smaps_rollup). With this flag set:
threads / processes group by their literal name; smaps
rows preserve their per-PID identity (pcomm[tgid]
instead of the normalized pcomm pattern). The
digit/hex/alpha-prefix placeholders are bypassed on every
axis. Has no effect under --group-by comm-exact
(already literal) or --group-by cgroup. Mirror of
--no-cg-normalize for the cgroup axis.
no_cg_normalize: boolDisable token-based pattern normalization for the cgroup
axis (--group-by cgroup). Cgroup paths group by literal
post---cgroup-flatten path — Layer 1 (systemd template
@<id>.service → @{I}.service), Layer 2 (token
normalization), and Layer 3 (tighten) are all bypassed.
Has no effect under any other grouping.
sort_by: StringMulti-key sort spec for the diff rows. Format:
metric1[:dir1],metric2[:dir2],... where each metric is
one of the primary or derived metric names (run
ctprof metric-list for the full vocabulary) and
dir is asc or desc (default desc). Groups rank by
the tuple (metric1_delta, metric2_delta, …) under
lexicographic order with per-key direction; rows within a
group keep registry order. Empty (the default) keeps the
“biggest |delta_pct|” sort. Examples:
--sort-by wait_sum:desc,run_time_ns:desc— rank by the largest scheduler-wait deltas first, breaking ties by run-time delta.--sort-by hiwater_rss_bytes:desc— rank by the largest peak-RSS growth across the snapshot. Useful for memory-leak investigations.--sort-by avg_wait_ns:asc— rank by smallest average wait time first; surfaces the most-improved processes.
Affects only the per-thread metric table and the
derived-metrics section. The ## smaps_rollup
sub-table sorts process rows independently by absolute
Rss delta descending (tiebreak: max-Rss, then name; see
sorted_smaps_process_keys); a future flag could expose that knob,
but --sort-by does not propagate to it today.
Parsed by parse_sort_by into CompareOptions::sort_by.
display_format: DisplayFormatPer-row column layout. full emits the
seven-column form; delta-only drops baseline +
candidate; no-pct drops the percentage column;
arrow collapses baseline / candidate into one
baseline -> candidate cell paired with separate Delta
and Pct columns; pct-only keeps just the percentage.
arrow (default) collapses baseline / candidate into
one cell paired with Delta and Pct columns.
--columns (below) overrides the format’s default
column set when both are present.
columns: StringComma-separated column names to render. Empty (the
default) means “use the column set selected by
–display-format.” Valid names: group, threads,
metric, baseline, candidate, delta, %,
arrow, tags, uptime. Order in the spec is the
rendered order.
Example: --columns metric,delta,%. Applies to the
primary section’s per-metric table only; secondary
tables (cgroup-stats, smaps-rollup, etc.) have fixed
column shapes and ignore this flag.
sections: StringComma-separated section names to render. Empty (the
default) renders every section that has data. When
non-empty, restricts output to the listed sub-tables —
every section not named is suppressed before its
data-availability gate runs. Valid names: primary,
taskstats-delay, derived, cgroup-stats,
cgroup-limits, memory-stat, memory-events,
pressure, host-pressure, smaps-rollup,
sched-ext. Useful for narrowing a wide compare to one
area of interest. Example:
--sections primary,host-pressure.
metrics: StringComma-separated metric names to render. Empty (the
default) renders every metric in the primary and
derived sub-tables. When non-empty, restricts the
rendered ROWS to the listed names — names must come
from the ctprof metric-list vocabulary
(CTPROF_METRICS or CTPROF_DERIVED_METRICS).
Useful for zooming on a specific counter family
without computing every metric: --metrics run_time_ns,wait_sum,affine_success_ratio. Composes
with --sections — naming --sections primary --metrics run_time_ns shows a single primary row.
wrap: boolWrap table cells to fit the terminal width. Off by default — wide tables can spill past the terminal edge, matching the prior shell-pipeline-friendly layout. When set, cells too wide for the available width wrap inside the cell rather than overflowing, at the cost of taller rows. The wrap kicks in only when stdout is a tty (the terminal width is unknown otherwise); when piped to a file or another command, the flag is silently dropped and output stays unwrapped so awk/grep pipelines see the same byte sequence as without the flag.
limit: usizeMaximum rendered lines per section. Sections whose table
output exceeds this limit are truncated with a notice
showing the number of hidden lines. Applies independently
to each sub-table (primary, derived, smaps-rollup, etc.).
0 disables truncation entirely. Default 500.
Trait Implementations§
Source§impl Args for CtprofCompareArgs
impl Args for CtprofCompareArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§impl Debug for CtprofCompareArgs
impl Debug for CtprofCompareArgs
Source§impl FromArgMatches for CtprofCompareArgs
impl FromArgMatches for CtprofCompareArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for CtprofCompareArgs
impl RefUnwindSafe for CtprofCompareArgs
impl Send for CtprofCompareArgs
impl Sync for CtprofCompareArgs
impl Unpin for CtprofCompareArgs
impl UnwindSafe for CtprofCompareArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more