forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zcache iostat should survive an agent restart (openzfs#96)
- Loading branch information
Don Brady
authored
Jan 21, 2022
1 parent
7b15686
commit 287ee6c
Showing
15 changed files
with
280 additions
and
144 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/*! | ||
Alternative to `println!` macros suitable for use in commands. | ||
The `println!` flavors of macros are good for debugging output but not suitable for | ||
production code since they panic when their output is not fully consumed (i.e. write | ||
to a stream that has closed). | ||
The println replacement macros in this module will terminate the process if writing | ||
to stdout/stderr returns an error (like `EPIPE`) rather than cause a panic. | ||
!*/ | ||
|
||
/// Similar to `print!` macro, except it terminates the process on write errors (does not panic). | ||
#[macro_export] | ||
macro_rules! write_stdout { | ||
($($arg:tt)*) => ({ | ||
use std::io::Write; | ||
if let Err(_) = write!(std::io::stdout(), $($arg)*) { | ||
std::process::exit(0) | ||
} | ||
}) | ||
} | ||
|
||
/// Similar to `println!` macro, except it terminates the process on write errors (does not panic). | ||
#[macro_export] | ||
macro_rules! writeln_stdout { | ||
($($arg:tt)*) => ({ | ||
use std::io::Write; | ||
if let Err(_) = writeln!(std::io::stdout(), $($arg)*) { | ||
std::process::exit(0) | ||
} | ||
}) | ||
} | ||
|
||
/// Similar to `eprint!` macro, except it terminates the process on write errors (does not panic). | ||
#[macro_export] | ||
macro_rules! write_stderr { | ||
($($arg:tt)*) => ({ | ||
use std::io::Write; | ||
if let Err(_) = write!(std::io::stderr(), $($arg)*) { | ||
std::process::exit(0) | ||
} | ||
}) | ||
} | ||
|
||
/// Similar to `eprintln!` macro, except it terminates the process on write errors (does not panic). | ||
#[macro_export] | ||
macro_rules! writeln_stderr { | ||
($($arg:tt)*) => ({ | ||
use std::io::Write; | ||
if let Err(_) = writeln!(std::io::stderr(), $($arg)*) { | ||
std::process::exit(0) | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.