diff options
author | David 'Digit' Turner <digit@android.com> | 2011-04-26 18:09:17 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2011-04-28 16:41:50 +0200 |
commit | d4d688e926097faba7fd3717d1c0d3f296bdb526 (patch) | |
tree | b6e89c99abae42e5bcef26afaa2952b5a870895b /hw/goldfish_trace.c | |
parent | a65e41529e4e3900372d54859f8c559cf79d953c (diff) | |
download | external_qemu-d4d688e926097faba7fd3717d1c0d3f296bdb526.zip external_qemu-d4d688e926097faba7fd3717d1c0d3f296bdb526.tar.gz external_qemu-d4d688e926097faba7fd3717d1c0d3f296bdb526.tar.bz2 |
New goldfish_pipe virtual device.
This adds a new virtual hardware device named "goldfish_pipe"
used to implement a very fast communication channel between the
guest system and the emulator.
IMPORTANT: This depends on a special kernel driver, see:
https://review.source.android.com/#change,22496
Usage from the guest is simply the following:
fd = open("/dev/qemu_pipe", O_RDWR);
const char* pipename = "pipe:<name>";
ret = write(fd, pipename, strlen(pipename)+1);
if (ret < 0) {
/* could not connect to service named <name> */
}
/* now you can read()/write()/close() as a normal
* file descriptor to exchange data with the service.
*/
In addition, this implements the following pipe services in the
emulator:
tcp:<port>
tcp:<hostname>:<port>
unix:<path>
opengles
The 'tcp:' and 'unix:' services simply redirect to a TCP or Unix
socket on the host with minimal
The 'opengles' service simply connects to tcp:locahost:22468 for now.
We may change this to be more configurable in the future, but that's
the port number used by the current experimental OpenGL ES hardware
emulation host libraries / programs.
Benchmarking with a simple ping-pong program shows that the
guest <-> emulator can achieve a roundtrip bandwidth of 192 MB/s
(on a 2.7 Ghz Xeon PC).
Using the tcp: service to talk to a ping-pong server listening
on localhost reaches 102 MB/s on the same machine, using a Unix
socket reaches 140 MB/s.
By contrast, using standard sockets in the guest reaches only
3.8 MB/s on the same machine (and requires special privileges
from the application anyway).
Diffstat (limited to 'hw/goldfish_trace.c')
-rw-r--r-- | hw/goldfish_trace.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/hw/goldfish_trace.c b/hw/goldfish_trace.c index ee51a8b..02f9b8d 100644 --- a/hw/goldfish_trace.c +++ b/hw/goldfish_trace.c @@ -15,7 +15,6 @@ */ #include "qemu_file.h" #include "goldfish_trace.h" -#include "goldfish_pipe.h" #include "sysemu.h" #include "trace.h" #ifdef CONFIG_MEMCHECK @@ -177,7 +176,6 @@ static void trace_dev_write(void *opaque, target_phys_addr_t offset, uint32_t va memcheck_exit(value); } #endif // CONFIG_MEMCHECK - goldfish_pipe_thread_death((int)tid); break; case TRACE_DEV_REG_NAME: // record thread name vstrcpy(value, exec_path, CLIENT_PAGE_SIZE); @@ -350,13 +348,6 @@ static void trace_dev_write(void *opaque, target_phys_addr_t offset, uint32_t va break; #endif // CONFIG_MEMCHECK - case TRACE_DEV_PIPE_COMMAND: - case TRACE_DEV_PIPE_ADDRESS: - case TRACE_DEV_PIPE_SIZE: - case TRACE_DEV_PIPE_CHANNEL: - goldfish_pipe_write(tid, ((offset >> 2) - TRACE_DEV_PIPE_BASE), value); - break; - default: if (offset < 4096) { cpu_abort(cpu_single_env, "trace_dev_write: Bad offset %x\n", offset); @@ -379,12 +370,6 @@ static uint32_t trace_dev_read(void *opaque, target_phys_addr_t offset) case TRACE_DEV_REG_ENABLE: // tracing enable return tracing; - case TRACE_DEV_PIPE_COMMAND: - case TRACE_DEV_PIPE_ADDRESS: - case TRACE_DEV_PIPE_SIZE: - case TRACE_DEV_PIPE_CHANNEL: - return goldfish_pipe_read(tid, (offset >> 2) - TRACE_DEV_PIPE_BASE); - default: if (offset < 4096) { cpu_abort(cpu_single_env, "trace_dev_read: Bad offset %x\n", offset); |