Skip to content

Commit

Permalink
#SiliFuzz Enable tracing when making aarch64 snapshots
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 715566184
  • Loading branch information
dougkwan authored and copybara-github committed Jan 15, 2025
1 parent 71d518d commit 57a5090
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
9 changes: 2 additions & 7 deletions runner/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ cc_library(
srcs = ["snap_maker.cc"],
hdrs = ["snap_maker.h"],
deps = [
":disassembling_snap_tracer",
"@silifuzz//common:mapped_memory_map",
"@silifuzz//common:memory_bytes_set",
"@silifuzz//common:memory_mapping",
Expand All @@ -392,13 +393,7 @@ cc_library(
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
] + select({
"@silifuzz//build_defs/platform:aarch64": [
],
"@silifuzz//build_defs/platform:x86_64": [
":disassembling_snap_tracer",
],
}),
],
)

cc_library(
Expand Down
9 changes: 1 addition & 8 deletions runner/snap_maker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "./common/snapshot_enums.h"
#include "./common/snapshot_printer.h"
#include "./player/trace_options.h"
#include "./runner/disassembling_snap_tracer.h"
#include "./runner/driver/runner_driver.h"
#include "./snap/gen/reserved_memory_mappings.h"
#include "./snap/gen/snap_generator.h"
Expand All @@ -46,10 +47,6 @@
#include "./util/page_util.h"
#include "./util/platform.h"

#if defined(__x86_64__)
#include "./runner/disassembling_snap_tracer.h"
#endif

namespace silifuzz {

using snapshot_types::Endpoint;
Expand Down Expand Up @@ -166,9 +163,6 @@ absl::StatusOr<Snapshot> SnapMaker::RecordEndState(const Snapshot& snapshot) {
absl::StatusOr<Snapshot> SnapMaker::CheckTrace(
const Snapshot& snapshot, const TraceOptions& trace_options) const {
Snapshot copy = snapshot.Copy();
// TODO(ncbray): instruction filtering on aarch64. This will likely involve
// static decompilation rather than dynamic tracing.
#if defined(__x86_64__)
ASSIGN_OR_RETURN_IF_NOT_OK(
RunnerDriver driver,
RunnerDriverFromSnapshot(snapshot, opts_.runner_path));
Expand All @@ -187,7 +181,6 @@ absl::StatusOr<Snapshot> SnapMaker::CheckTrace(
absl::StrJoin(trace_result.disassembly, "\n"));
trace_data.add_platform(CurrentPlatformId());
copy.set_trace_data({trace_data});
#endif
return copy;
}

Expand Down

0 comments on commit 57a5090

Please sign in to comment.