Skip to content

Commit

Permalink
Update TraceProgram docstring (#1720)
Browse files Browse the repository at this point in the history
Summary: Updates documentation for the `pxtrace.TraceProgram` object
which enables deploying bpftrace programs to specific hosts via
selectors.

Relevant Issues: pixie-io/docs.px.dev#277

Type of change: /kind documentation

Test Plan: Existing targets.

Signed-off-by: Benjamin Kilimnik <[email protected]>
  • Loading branch information
benkilimnik authored Oct 3, 2023
1 parent 4730a96 commit 76a3ad5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/carnot/planner/probes/tracing_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Status TraceModule::Init() {
std::placeholders::_2, std::placeholders::_3),
ast_visitor()));
// add method to the pxtrace module, pxtrace.TraceProgram
PX_RETURN_IF_ERROR(program_fn->SetDocString(kTraceProgramDocstring));
AddMethod(kTraceProgramID, program_fn);

PX_ASSIGN_OR_RETURN(std::shared_ptr<FuncObject> shared_object_fn,
Expand Down
9 changes: 4 additions & 5 deletions src/carnot/planner/probes/tracing_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class TraceModule : public QLObject {
name (str): The name of the tracepoint. Should be unique with the probe_fn.
table_name (str): The table name to write the results. The table is created
if it does not exist. The table schema must match if the table does exist.
probe_fn (px.ProbeFn): The tracepoint function.
probe_fn (Union[px.ProbeFn, str, pxtrace.TraceProgram, List[pxtrace.TraceProgram]]): The tracepoint function, BPFTrace program or pxtrace.TraceProgram to deploy.
target (Union[px.UPID,px.SharedObject,pxtrace.PodProcess,pxtrace.LabelSelector]): The process or shared object
to trace as specified by unique Vizier PID.
ttl (px.Duration): The length of time that a tracepoint will stay alive, after
Expand All @@ -199,16 +199,15 @@ class TraceModule : public QLObject {

inline static constexpr char kTraceProgramID[] = "TraceProgram";
inline static constexpr char kTraceProgramDocstring[] = R"doc(
Creates a trace program.
Creates a trace program. Selectors for supported hosts can be specified using key-value arguments.
:topic: pixie_state_management
Args:
program (str): The BPFtrace program string.
min_kernel (str, optional): The minimum kernel version that the tracepoint is supported on. Format is <version>.<major>.<minor>.
max_kernel (str, optional): The maximum kernel version that the tracepoint is supported on. Format is <version>.<major>.<minor>.
min_kernel (str, optional): The minimum kernel version that the tracepoint is supported on. Format is `<version>.<major>.<minor>`.
max_kernel (str, optional): The maximum kernel version that the tracepoint is supported on. Format is `<version>.<major>.<minor>`.
host_name (str, optional): Restrict the tracepoint to a specific host.
(Additional selectors may be added in the future.)
Returns:
TraceProgram: A pointer to the TraceProgram that can be passed as a probe_fn
Expand Down

0 comments on commit 76a3ad5

Please sign in to comment.