diff --git a/README.md b/README.md index 42b2542d7..577728f7c 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,8 @@ For network support, you have to link the Go application with the flag `-lnetgo` 2. If Qemu is started by our proxy and the environment variable `HERMIT_KVM` is set to `0`, the virtual machine will be not accelerated by KVM. In this case, the configuration flag `--with-mtune=name` should be avoided. With the environment variable `HERMIT_APP_PORT`, an additional port can be open to establish an TCP/IP connection with your application. -3. By setting the environment variable `HERMIT_VERBOSE` to `1`, the proxy prints at termination the kernel log messages onto the screen. +3. By setting the environment variable `HERMIT_VERBOSE` to `1`, the proxy prints at termination the kernel log messages onto the screen. 4. If `HERMIT_DEBUG` is set to `1`, Qemu will establish an gdbserver, which will be listen port 1234. Afterwards you are able debug HermitCore applications remotely. +5. By setting the environment variable `HERMIT_CAPTURE_NET' to `1` and `HERMIT_ISLE` to `qemu`, Qemu captures the network traffic and + creates the trace file *qemu-vlan0.pcap*. For instance with [Wireshark](https://www.wireshark.org) you are able to analyze the file. diff --git a/tools/proxy.c b/tools/proxy.c index 7f4e1de90..f8a101948 100644 --- a/tools/proxy.c +++ b/tools/proxy.c @@ -393,6 +393,17 @@ static int init_qemu(char *path) qemu_argv[i] = "-s"; } + str = getenv("HERMIT_CAPTURE_NET"); + if (str && (strcmp(str, "0") != 0)) + { + for(i=0; qemu_argv[i] != NULL; i++) + ; + + // add flags to capture the network traffic + qemu_argv[i] = "-net"; + qemu_argv[i+1] = "dump"; + } + str = getenv("HERMIT_VERBOSE"); if (str && (strcmp(str, "0") != 0)) { @@ -401,11 +412,6 @@ static int init_qemu(char *path) for(i=0; qemu_argv[i] != NULL; i++) printf("%s ", qemu_argv[i]); - // add flags to create dump of the network traffic - //qemu_argv[i] = "-net"; - //qemu_argv[i+1] = "dump"; - //printf("%s %s\n", qemu_argv[i], qemu_argv[i+1]); - fflush(stdout); }