Collect system network usages in profiler.

Guarded by flag `--experimental_collect_system_network_usage`, the profiler can now collect system network usages. The data is collected by system calls through JNI which is only implemented on macOS in this change.

PiperOrigin-RevId: 473744411
Change-Id: I845fececcbb92e883723e5eba90b58340f7e8dfb
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
index 8e4ffdc..672a6d9 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
@@ -325,6 +325,14 @@
   public boolean collectLoadAverageInProfiler;
 
   @Option(
+      name = "experimental_collect_system_network_usage",
+      defaultValue = "false",
+      documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
+      effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING},
+      help = "If enabled, the profiler collects the system's network usage.")
+  public boolean collectSystemNetworkUsage;
+
+  @Option(
       name = "memory_profile",
       defaultValue = "null",
       documentationCategory = OptionDocumentationCategory.LOGGING,