File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,17 @@ def msr_reader_bin(test_fc_session_root_path):
274274 yield msr_reader_bin_path
275275
276276
277+ @pytest .fixture (scope = "session" )
278+ def jailer_time_bin (test_fc_session_root_path ):
279+ """Build a binary that fakes fc"""
280+ jailer_time_bin_path = os .path .join (test_fc_session_root_path , "jailer_time" )
281+ build_tools .gcc_compile (
282+ "host_tools/jailer_time.c" ,
283+ jailer_time_bin_path ,
284+ )
285+ yield jailer_time_bin_path
286+
287+
277288@pytest .fixture
278289def bin_seccomp_paths ():
279290 """Build jailers and jailed binaries to test seccomp.
Original file line number Diff line number Diff line change 1+ // Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ // SPDX-License-Identifier: Apache-2.0
3+
4+ // This is used by `performance/test_jailer.py`
5+
6+ #include <stdio.h>
7+ #include <time.h>
8+
9+ int main (int argc , char * * argv ) {
10+ // print current time in us
11+ struct timespec now = {0 };
12+ clock_gettime (CLOCK_MONOTONIC , & now );
13+ unsigned long long current_ns = (unsigned long long )now .tv_sec * 1000000000 + (unsigned long long )now .tv_nsec ;
14+ unsigned long long current_us = current_ns / 1000 ;
15+ printf ("%llu\n" , current_us );
16+
17+ // print the --start-time-us value
18+ printf ("%s" , argv [4 ]);
19+ }
You can’t perform that action at this time.
0 commit comments