Documentation

Lean.PostprocessTraces.Basic

See Lean.PostprocessTraces.

A structured view of a trace message (MessageData.trace), used by trace postprocessors (see TracePostprocessor).

Instances For

    Reassembles the MessageData of a trace tree.

    @[reducible, inline]

    A trace postprocessor transforms the trace roots of a trace message before it is reported, e.g. by filtering out irrelevant subtrees or pre-expanding interesting nodes. Returning an empty array drops the trace message entirely.

    Traces are reported as one message per source range inside a command, and a postprocessor is applied to each of these messages separately; it therefore cannot move trace roots from one source range to another.

    Postprocessors are applied by the postprocess_traces post in cmd command and can be composed left-to-right with >=>.

    Equations
    Instances For
      @[reducible, inline]

      A pattern selects the trace subtrees that an operation acts on (see filter, hoist, and expand). Patterns are ordinary predicates: the built-in ones (such as containsString, unsuccessful, or minTimeMs) can be combined with custom conditions in a fun.

      Equations
      Instances For

        The TraceData of a trace node; none for leaf messages.

        Equations
        Instances For

          The trace class of a trace node; none for leaf messages.

          Equations
          Instances For

            Replaces the children of a trace node. Leaf messages are returned unchanged.

            Equations
            Instances For

              Transforms the TraceData of a trace node. Leaf messages are returned unchanged.

              Equations
              Instances For

                Elapsed time of this node in seconds; 0 if no profiling data is available.

                Equations
                Instances For

                  Elapsed time of this node that is not accounted for by its children, in seconds; 0 if no profiling data is available.

                  Equations
                  Instances For

                    The message of this node (without its children), formatted as a string. Useful for text-based filters but expensive.

                    Equations
                    Instances For

                      The TraceResult of a trace node; none for leaf messages and nodes without a result.

                      Equations
                      Instances For

                        Collects all maximal subtrees satisfying p in acc: adds t itself if p t holds, and otherwise recurses into the children. Matching subtrees are not searched for nested matches.

                        Prunes the tree to the subtrees satisfying p, keeping their ancestors for context; none if there is no match. The resulting tree consists of those nodes that either have a matching ancestor or transitive child. Matching subtrees are not searched for nested matches.

                        Decomposes the synthetic container message produced by addTraceAsMessages (.tagged `trace <| .trace _ _ roots, possibly inside context wrappers) into its trace roots, together with a function that reassembles the container from transformed roots.

                        Equations
                        Instances For

                          Applies post to a trace message (see addTraceAsMessages), returning none if the postprocessor dropped all roots of the message. Non-trace messages are returned unchanged.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Runs a command and returns all messages (sync and async) it produces, clearing the snapshot tasks after collection so that async messages are not reported twice. The surrounding message log is unaffected; it is restored even if the command is interrupted.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              Evaluates the postprocessor without leaking the traces produced by elaborating the postprocessor term itself into the (typically trace-enabled) surrounding context.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For