Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
Signed-off-by: int-y1 <[email protected]>
  • Loading branch information
int-y1 authored and Xyene committed Mar 3, 2024
1 parent 35a0fbd commit 7509347
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ magic-trace:

You use it like [`perf`](https://en.wikipedia.org/wiki/Perf_(Linux)): point it to a process and off it goes. The key difference from `perf` is that instead of sampling call stacks throughout time, magic-trace uses [Intel Processor Trace](https://man7.org/linux/man-pages/man1/perf-intel-pt.1.html) to snapshot a ring buffer of *all control flow* leading up to a chosen point in time[^1]. Then, you can explore an interactive timeline of what happened.

You can point magic-trace at a function such that when your application calls it, magic-trace takes a snapshot. Alternatively, attach it to a running process and detatch it with <kbd>Ctrl</kbd>+<kbd>C</kbd>, to see a trace of an arbitrary point in your program.
You can point magic-trace at a function such that when your application calls it, magic-trace takes a snapshot. Alternatively, attach it to a running process and detach it with <kbd>Ctrl</kbd>+<kbd>C</kbd>, to see a trace of an arbitrary point in your program.

[^1]: `perf` can do this too, but that's not how most people use it. In fact, if you peek under the hood you'll see that magic-trace uses `perf` to drive Intel PT.

Expand Down
2 changes: 1 addition & 1 deletion core/perf_map.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
open! Core
open! Async

(* JITed lanaguages like java and javascript can write perf map files which provide a mapping of
(* JITed languages like java and javascript can write perf map files which provide a mapping of
address to symbol name.
They're documented here:
Expand Down
2 changes: 1 addition & 1 deletion core/trace_filter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ let param =
(optional Unevaluated.arg_type)
~doc:
"_ [-filter \"(<START> <STOP>)\"] restricts the output of magic-trace to events \
ocurring between consecutive occurences of START and STOP. If either function is \
occurring between consecutive occurrences of START and STOP. If either function is \
not called in the trace, no output will be produced."
;;
2 changes: 1 addition & 1 deletion src/perf_tool_backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ module Recording = struct
"Warning: magic-trace will only be able to snapshot when magic-trace is \
Ctrl+C'd, not when the application it's running ends. If that application \
ends before magic-trace can snapshot it, the resulting trace will be empty. \
The ability to snapshot when an application teminates was added to perf's \
The ability to snapshot when an application terminates was added to perf's \
userspace tools in version 5.4. For more information, see:\n\
https://github.com/janestreet/magic-trace/wiki/Supported-platforms,-programming-languages,-and-runtimes#supported-perf-versions\n\
%!"
Expand Down
2 changes: 1 addition & 1 deletion src/pow2_pages.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
open! Core

(* Like [Byte_units.t], but must represent a power of 2 number of pages. magic-trace usees these to
(* Like [Byte_units.t], but must represent a power of 2 number of pages. magic-trace uses these to
represent perf's "auxtrace mmap size" (grep for that string in
https://man7.org/linux/man-pages/man1/perf-intel-pt.1.html). *)
type t [@@deriving sexp_of]
Expand Down
4 changes: 2 additions & 2 deletions src/trace_writer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ end = struct
| Pushtrap ->
(* CR-someday tbrindus: maybe we should have [Callstack.t] know about the
concept of trap handlers, and have e.g. [Callstack.{pushtrap,poptrap}]
insert markers into an auxilliary data structure.
insert markers into an auxiliary data structure.
Then we could have operations like "close all frames until the last
trap", and enforce invariants like "you can't [ret] past a trap without
Expand Down Expand Up @@ -961,7 +961,7 @@ let warn_decode_error ~instruction_pointer ~message =
[%string "'%{message}' @ IP %{instruction_pointer#Int64.Hex}."])
;;

(* Write perf_events into a file as a Fuschia trace (stack events). Events should be
(* Write perf_events into a file as a Fuchsia trace (stack events). Events should be
collected with --itrace=be or cre, and -F pid,tid,time,flags,addr,sym,symoff as per
the constants defined above. *)
let write_event (T t) ?events_writer event =
Expand Down
2 changes: 1 addition & 1 deletion src/trace_writer.mli
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ val write_event
-> Event.With_write_info.t
-> unit

(** Updates interal data structures when trace ends. If [to_time] is passed, will
(** Updates internal data structures when trace ends. If [to_time] is passed, will
shift to new start time which is useful when writing out multiple snapshots
from perf. *)
val end_of_trace : ?to_time:Time_ns.Span.t -> t -> unit
2 changes: 1 addition & 1 deletion test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ let%expect_test "time batch spreading" =
return ()
;;

let%expect_test "enqueing events at start" =
let%expect_test "enqueuing events at start" =
let%bind.With _dirname = Expect_test_helpers_async.within_temp_dir in
let events =
Trace_helpers.(
Expand Down
2 changes: 1 addition & 1 deletion vendor/tracing/src/parser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ let parse_event_record t =
None
;;

(* This function advances through the trace until it finds a Fuschia record matching one
(* This function advances through the trace until it finds a Fuchsia record matching one
of the records types defined in [Record.t]. *)
let rec parse_until_next_external_record t =
if Iobuf.length t.iobuf < 8 then raise End_of_file;
Expand Down
2 changes: 1 addition & 1 deletion vendor/tracing/src/queue_to_spans.mli
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This module lets you guess a start time for events using the simple property that in a
single-threaded system an event can't start processing until the later of when it
arrives and when you finished processing the preceeding event to be sent out. *)
arrives and when you finished processing the preceding event to be sent out. *)

open! Core

Expand Down
2 changes: 1 addition & 1 deletion vendor/tracing/zero/writer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Header_template = struct

(* Because of the two bitfields for total size and argument count, we can effectively
treat the full [Header_template] as the sum of integers representing the arguments
we've comitted to. We can subtract integers representing those individual arguments
we've committed to. We can subtract integers representing those individual arguments
to remove them from the template, and if we reach zero then we've subtracted
compatible arguments. Except for issues involving overflow between the two fields,
which are unlikely to happen accidentally in practice, and this is only used by
Expand Down
6 changes: 3 additions & 3 deletions vendor/tracing/zero/writer.mli
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ val max_interned_string_length : int
val intern_string : t -> string -> String_id.t

(** This interns a string while re-using a set of 100 reserved string IDs (by default, the
number can be overriden at writer creation). Setting the string in a slot overwrites
number can be overridden at writer creation). Setting the string in a slot overwrites
what was previously in that slot so any further events written in the trace see the new
value. This allows arbitrarily many unique strings to be used in a trace, unlike
[intern_string].*)
Expand Down Expand Up @@ -99,7 +99,7 @@ module Arg_types : sig
end

(** Most event writer functions take a common set of arguments including a commitment to
what event arguments will be added ([arg_types]), a thread the event occured on, a
what event arguments will be added ([arg_types]), a thread the event occurred on, a
[category] which is an arbitrary string classifying the event visible in UIs and
potentially used for filtering, a [name] that's the main label for the event, and a
timestamp in "ticks" which defaults to nanoseconds since the start of the trace, but
Expand Down Expand Up @@ -220,7 +220,7 @@ module Expert : sig
using the usual [write_*] functions, saving about 6ns per event.
The only caller-visible check omission should be that it doesn't check the
corectness of arguments, which can result in invalid trace files if the arguments
correctness of arguments, which can result in invalid trace files if the arguments
written don't match the header. Users of this function must use
[Write_arg_unchecked] because it doesn't set the necessary state for checking. *)
val write_from_header_with_tsc : t -> header:header -> unit
Expand Down

0 comments on commit 7509347

Please sign in to comment.