Skip to content

Commit

Permalink
Merge core and src directories
Browse files Browse the repository at this point in the history
The split made sense back when we were pursuing a direct backend, but
now it only serves to confuse.

Signed-off-by: Tudor Brindus <[email protected]>
  • Loading branch information
Xyene committed Jun 3, 2024
1 parent 65e53d1 commit d3a25d3
Show file tree
Hide file tree
Showing 69 changed files with 12 additions and 67 deletions.
8 changes: 0 additions & 8 deletions core/dune

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion src/breakpoint.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open! Core
open! Import

type t

Expand Down
1 change: 0 additions & 1 deletion src/callstack_compression.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
(callstacks and backtraces are essentially the same) *)

open Core
open Import

type t =
{ symbol_to_id : (Symbol.t, int) Hashtbl.t
Expand Down
1 change: 0 additions & 1 deletion src/callstack_compression.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open Core
open Import

type t =
{ symbol_to_id : (Symbol.t, int) Hashtbl.t
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
(names breakpoint_stubs boot_time_stubs ptrace_stubs))
(libraries core async core_unix.filename_unix fzf re shell
core_unix.sys_unix cohttp cohttp_static_handler core_unix.signal_unix
tracing magic_trace magic_trace_core)
tracing magic_trace owee angstrom expect_test_helpers_core)
(inline_tests)
(preprocess
(pps ppx_jane)))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/for_range.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open! Core
open! Async
open! Import

module Symbol_hit = struct
module Kind = struct
Expand Down
3 changes: 1 addition & 2 deletions src/for_range.mli
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
open! Core
open! Async
open! Import

val decode_events_and_annotate
: decode_events:(unit -> Import.Decode_result.t Deferred.Or_error.t)
: decode_events:(unit -> Decode_result.t Deferred.Or_error.t)
-> range_symbols:Trace_filter.t
-> (Event.With_write_info.t Async.Pipe.Reader.t list * unit Deferred.Or_error.t)
Deferred.Or_error.t
23 changes: 0 additions & 23 deletions src/import.ml

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/perf_decode.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open! Core
open! Async
open! Import

let saturating_sub_i64 a b =
match Int64.(to_int (a - b)) with
Expand Down
1 change: 0 additions & 1 deletion src/perf_decode.mli
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

open! Core
open! Async
open! Import

val to_events
: ?perf_maps:Perf_map.Table.t
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/perf_tool_backend.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open! Core
open! Async
open! Import

(* PAGER=cat because perf spawns [less] if you get the arguments wrong, and that keeps the
parent process alive even though it just failed. That, in turn, makes magic-trace stop
Expand Down
2 changes: 0 additions & 2 deletions src/perf_tool_backend.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
(** A backend that uses the [perf] command line tool for recording and decoding *)
open! Import

include Backend_intf.S
1 change: 0 additions & 1 deletion src/process_info.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open! Core
open! Import

module Entry = struct
module Cmdline = struct
Expand Down
1 change: 0 additions & 1 deletion src/process_info.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open! Core
open! Import

module Entry : sig
module Cmdline : sig
Expand Down
1 change: 0 additions & 1 deletion src/real_trace.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open! Core
open! Import
open Trace_writer_intf

let create (trace : Tracing.Trace.t) =
Expand Down
1 change: 0 additions & 1 deletion src/real_trace.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open! Core
open! Import
open Trace_writer_intf

(* Creates an abstract [S_trace] out of a real [Tracing] backend. I know this isn't a great reason,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/trace.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

open! Core
open! Async
open! Import

let supports_command command =
Lazy.from_fun (fun () ->
Expand Down
1 change: 0 additions & 1 deletion src/trace.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open! Core
open! Async
open! Import

val command : Command.t

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/trace_writer.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open! Core
open! Import

let debug = ref false
let is_kernel_address addr = Int64.(addr < 0L)
Expand Down
1 change: 0 additions & 1 deletion src/trace_writer.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open! Core
open! Import

(* Enable this in tests to see [t] after every perf event. Don't forget to disable it when
you're done!
Expand Down
1 change: 0 additions & 1 deletion src/trace_writer_intf.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open! Core
open! Import

module type S_trace = sig
type thread
Expand Down
1 change: 0 additions & 1 deletion src/tracing_tool_output.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open! Core
open! Async
open! Import

module Serve = struct
type enabled =
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion test/callstack_compression_test.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open Core
open Magic_trace_lib
open Import

let compressed_test_string =
{|(
Expand Down
3 changes: 1 addition & 2 deletions test/demangle_ocaml_symbols.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
open! Core
open Magic_trace_core

let demangle_symbol_test symbol =
let demangle_symbol = Demangle_ocaml_symbols.demangle symbol in
let demangle_symbol = Magic_trace_lib.Demangle_ocaml_symbols.demangle symbol in
print_s [%sexp (demangle_symbol : string option)]
;;

Expand Down
2 changes: 1 addition & 1 deletion test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
(name magic_trace_app_test)
(inline_tests)
(libraries async core expect_test_helpers_core expect_test_helpers_async
magic_trace_lib magic_trace_core)
magic_trace_lib)
(preprocess
(pps ppx_jane)))
6 changes: 3 additions & 3 deletions test/ocaml_exceptions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ open! Async

let%expect_test "A raise_notrace OCaml exception" =
let ocaml_exception_info =
Magic_trace_core.Ocaml_exception_info.create
Magic_trace_lib.Ocaml_exception_info.create
~entertraps:[| 0x411030L |]
~pushtraps:[| 0x41100bL |]
~poptraps:[| 0x411026L |]
Expand Down Expand Up @@ -91,7 +91,7 @@ let%expect_test "A raise_notrace OCaml exception" =

let%expect_test "a corner case where a call doesn't return directly into a poptrap" =
let ocaml_exception_info =
Magic_trace_core.Ocaml_exception_info.create
Magic_trace_lib.Ocaml_exception_info.create
~entertraps:[| 0xffffffL (* not used *) |]
~pushtraps:[| 0xcb457dL |]
~poptraps:[| 0xcb459cL |]
Expand All @@ -115,7 +115,7 @@ let%expect_test "a corner case where a call doesn't return directly into a poptr

let%expect_test "the same test case above, as if there was no exception block" =
let ocaml_exception_info =
Magic_trace_core.Ocaml_exception_info.create
Magic_trace_lib.Ocaml_exception_info.create
~entertraps:[||]
~pushtraps:[||]
~poptraps:[||]
Expand Down
1 change: 0 additions & 1 deletion test/perf_script.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open! Core
open! Async
open Magic_trace_core
open Magic_trace_lib
module Time_ns = Time_ns_unix

Expand Down
5 changes: 2 additions & 3 deletions test/perf_script.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open! Core
open! Async
open! Magic_trace_core

(* Runs some perf script end-to-end through the perf_tool_backend and the trace_writer, printing
out generated traces as a string.
Expand All @@ -17,7 +16,7 @@ open! Magic_trace_core
val run
: ?debug:bool
-> ?events_writer:Magic_trace_lib.Tracing_tool_output.events_writer
-> ?ocaml_exception_info:Ocaml_exception_info.t
-> trace_scope:Trace_scope.t
-> ?ocaml_exception_info:Magic_trace_lib.Ocaml_exception_info.t
-> trace_scope:Magic_trace_lib.Trace_scope.t
-> Filename.t
-> unit Deferred.t
6 changes: 3 additions & 3 deletions test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ open! Async
open! Magic_trace_lib.Trace.For_testing

include struct
open Magic_trace_core
open Magic_trace_lib
module Decode_result = Decode_result
module Event = Event
module Symbol = Symbol
Expand Down Expand Up @@ -791,9 +791,9 @@ let%expect_test "filtered trace" =
;;

let%expect_test "get debug information from ELF" =
let elf = Magic_trace_core.Elf.create "sample-targets/ocaml-raise/sample.exe" in
let elf = Magic_trace_lib.Elf.create "sample-targets/ocaml-raise/sample.exe" in
let debug_table =
Magic_trace_core.Elf.addr_table (Option.value_exn elf)
Magic_trace_lib.Elf.addr_table (Option.value_exn elf)
|> Hashtbl.filter ~f:(fun info ->
match info.filename with
| Some "sample.ml" -> true
Expand Down

0 comments on commit d3a25d3

Please sign in to comment.