cl_genode: printing vgpu bench data

This commit is contained in:
amarmemic
2022-11-10 10:47:40 +01:00
parent 6c17984d6a
commit 6859f714b2
7 changed files with 45 additions and 1 deletions

View File

@@ -27,6 +27,11 @@ struct Session_client : Genode::Rpc_client<Session>
{
return call<Rpc_say_hello>(i);
}
void print_vgpu_bench(unsigned long i) override
{
call<Rpc_print_vgpu_bench>(i);
}
};
}

View File

@@ -15,6 +15,7 @@ struct Session : Genode::Session
virtual int say_hello(int& i) = 0;
virtual void register_vm(Genode::size_t size, Genode::Ram_dataspace_capability& ram_cap) = 0;
virtual int start_task(unsigned long kconf) = 0;
virtual void print_vgpu_bench(unsigned long i) = 0;
/*******************
** RPC interface **
@@ -23,8 +24,10 @@ struct Session : Genode::Session
GENODE_RPC(Rpc_say_hello, int, say_hello, int&);
GENODE_RPC(Rpc_register_vm, void, register_vm, Genode::size_t, Genode::Ram_dataspace_capability&);
GENODE_RPC(Rpc_start_task, int, start_task, unsigned long);
GENODE_RPC(Rpc_print_vgpu_bench, void, print_vgpu_bench, unsigned long);
GENODE_RPC_INTERFACE(Rpc_say_hello, Rpc_register_vm, Rpc_start_task);
GENODE_RPC_INTERFACE(Rpc_say_hello, Rpc_register_vm, Rpc_start_task, Rpc_print_vgpu_bench);
};
}

View File

@@ -27,6 +27,11 @@ int Session_component::say_hello(int& i)
return 42;
}
void Session_component::print_vgpu_bench(unsigned long i)
{
vgpu.print_vgpu_bench(i);
};
void Session_component::register_vm(Genode::size_t size, Genode::Ram_dataspace_capability& ram_cap_vm)
{
// create shared mem
@@ -103,11 +108,16 @@ Session_component::~Session_component()
_global_gpgpu_genode->freeRamCap(ram_cap);
}
Session_component* Root_component::_create_session(const char *)
{
return new (md_alloc()) Session_component();
}
Root_component::Root_component(Genode::Entrypoint &ep,
Genode::Allocator &alloc)
:

View File

@@ -26,6 +26,9 @@ struct Session_component : Genode::Rpc_object<Session>
void register_vm(Genode::size_t size, Genode::Ram_dataspace_capability& ram_cap) override;
int start_task(unsigned long kconf) override;
void print_vgpu_bench(unsigned long i) override;
};
class Root_component

View File

@@ -3,6 +3,8 @@
#include <util/fifo.h>
#include "kernel.h"
#include <base/log.h>
// driver
#define GENODE
@@ -78,6 +80,15 @@ namespace gpgpu_virt {
});
return ret;
}
/**
* @brief Print bench
*/
void print_vgpu_bench(unsigned long i)
{
Genode::log("bench result of vgpu ", i);
GPGPU_Driver::getInstance().printBenchResults();
};
};
}

View File

@@ -81,3 +81,10 @@ void cl_genode::wait(struct kernel_config* kconf)
asm("nop");
}
}
void cl_genode::print_vgpu_bench(unsigned long i)
{
backend_driver.print_vgpu_bench(i);
}

View File

@@ -103,6 +103,11 @@ public:
* @param kconf
*/
void wait(struct kernel_config* kconf);
/**
* @brief print bench results */
void print_vgpu_bench(unsigned long i);
};
#endif // CL_GENODE_H