mirror of
https://github.com/facebookexperimental/reverie.git
synced 2025-01-22 21:04:53 +00:00
03cbd6044d
Summary: Followed guide here https://www.internalfb.com/intern/wiki/Linting/License_Lint/ to add fbcode/hermetic_infra/** code to license linter. As we have parts of our code shipped as Open Source it's important to get this automated This diff is updating existing file's licenses to not get conflict after lint rule enablement Reviewed By: jasonwhite Differential Revision: D40674080 fbshipit-source-id: da6ecac036f8964619cf7912058f3a911558e7b1
50 lines
1.3 KiB
Rust
50 lines
1.3 KiB
Rust
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
mod config;
|
|
mod filter;
|
|
mod global_state;
|
|
mod tool;
|
|
|
|
use clap::Parser;
|
|
use config::Config;
|
|
use filter::Filter;
|
|
use reverie::Error;
|
|
use reverie_util::CommonToolArguments;
|
|
use tool::Strace;
|
|
|
|
/// A tool to trace system calls.
|
|
#[derive(Parser, Debug)]
|
|
struct Opts {
|
|
#[clap(flatten)]
|
|
common: CommonToolArguments,
|
|
|
|
/// The set of syscalls to trace. By default, all syscalls are traced. If
|
|
/// this is used, then only the specified syscalls are traced. By limiting
|
|
/// the set of traced syscalls, we can reduce the overhead of the tracer.
|
|
#[clap(long)]
|
|
trace: Vec<Filter>,
|
|
}
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), Error> {
|
|
let args = Opts::from_args();
|
|
|
|
let config = Config {
|
|
filters: args.trace,
|
|
};
|
|
|
|
let log_guard = args.common.init_tracing();
|
|
let tracer = reverie_ptrace::TracerBuilder::<Strace>::new(args.common.into())
|
|
.config(config)
|
|
.spawn()
|
|
.await?;
|
|
let (status, _) = tracer.wait().await?;
|
|
drop(log_guard); // Flush logs before exiting.
|
|
status.raise_or_exit()
|
|
}
|