Skip to content

Commit

Permalink
remove calls to mirage-profile in vnetif_backends.ml
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed May 7, 2024
1 parent bb600e2 commit 33b9ddf
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/vnetif_backends.ml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ module Uniform_packet_loss : Backend = struct

let write t id ~size fill =
if Random.float 1.0 < drop_p then
begin
MProf.Trace.label "pkt_drop";
Lwt.return (Ok ()) (* drop packet *)
end else
Lwt.return (Ok ()) (* drop packet *)
else
X.write t id ~size fill (* pass to real write *)

let create () =
Expand All @@ -125,10 +123,8 @@ module Uniform_no_payload_packet_loss : Backend = struct

let write t id ~size fill =
if size <= no_payload_len && Random.float 1.0 < drop_p then
begin
MProf.Trace.label "pkt_drop";
Lwt.return (Ok ()) (* drop packet *)
end else
Lwt.return (Ok ()) (* drop packet *)
else
X.write t id ~size fill (* pass to real write *)

let create () =
Expand Down Expand Up @@ -216,7 +212,6 @@ module On_off_switch = struct
if not !send_packets then
begin
Logs.info (fun f -> f "write dropping 1 packet");
MProf.Trace.label "pkt_drop";
Lwt.return (Ok ()) (* drop packet *)
end else
X.write t id ~size fill (* pass to real write *)
Expand Down

0 comments on commit 33b9ddf

Please sign in to comment.