2013-08-10 01:44:55 +00:00
|
|
|
/*
|
|
|
|
* \brief TRACE session interface
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2013-08-11
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 12:23:52 +00:00
|
|
|
* Copyright (C) 2013-2017 Genode Labs GmbH
|
2013-08-10 01:44:55 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 12:23:52 +00:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2013-08-10 01:44:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__TRACE_SESSION__TRACE_SESSION_H_
|
|
|
|
#define _INCLUDE__TRACE_SESSION__TRACE_SESSION_H_
|
|
|
|
|
2024-06-11 14:53:03 +00:00
|
|
|
#include <util/attempt.h>
|
2013-08-10 01:44:55 +00:00
|
|
|
#include <base/trace/types.h>
|
|
|
|
#include <dataspace/capability.h>
|
|
|
|
#include <session/session.h>
|
|
|
|
|
|
|
|
namespace Genode { namespace Trace { struct Session; } }
|
|
|
|
|
|
|
|
|
|
|
|
struct Genode::Trace::Session : Genode::Session
|
|
|
|
{
|
2017-05-24 12:41:19 +00:00
|
|
|
/**
|
|
|
|
* \noapi
|
|
|
|
*/
|
2013-08-10 01:44:55 +00:00
|
|
|
static const char *service_name() { return "TRACE"; }
|
|
|
|
|
2020-05-05 12:27:29 +00:00
|
|
|
enum { CAP_QUOTA = 6 };
|
2017-05-07 20:03:25 +00:00
|
|
|
|
2024-06-11 14:53:03 +00:00
|
|
|
enum class Alloc_rpc_error { OUT_OF_RAM, OUT_OF_CAPS };
|
|
|
|
enum class Alloc_policy_rpc_error { OUT_OF_RAM, OUT_OF_CAPS, INVALID };
|
|
|
|
enum class Trace_rpc_error { OUT_OF_RAM, OUT_OF_CAPS, FOREIGN,
|
|
|
|
SOURCE_IS_DEAD, INVALID_SUBJECT,
|
|
|
|
INVALID_POLICY };
|
2013-08-10 01:44:55 +00:00
|
|
|
|
2024-06-11 14:53:03 +00:00
|
|
|
using Alloc_policy_rpc_result = Attempt<Policy_id, Alloc_policy_rpc_error>;
|
|
|
|
using Subjects_rpc_result = Attempt<Num_subjects, Alloc_rpc_error>;
|
|
|
|
using Infos_rpc_result = Attempt<Num_subjects, Alloc_rpc_error>;
|
|
|
|
using Trace_rpc_result = Attempt<Trace_ok, Trace_rpc_error>;
|
2013-08-10 01:44:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
virtual ~Session() { }
|
|
|
|
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
** RPC declaration **
|
|
|
|
*********************/
|
|
|
|
|
|
|
|
GENODE_RPC(Rpc_dataspace, Dataspace_capability, dataspace);
|
2024-06-11 14:53:03 +00:00
|
|
|
GENODE_RPC(Rpc_alloc_policy, Alloc_policy_rpc_result, alloc_policy, Policy_size);
|
|
|
|
GENODE_RPC(Rpc_policy, Dataspace_capability, policy, Policy_id);
|
|
|
|
GENODE_RPC(Rpc_unload_policy, void, unload_policy, Policy_id);
|
|
|
|
GENODE_RPC(Rpc_trace, Trace_rpc_result, trace, Subject_id, Policy_id, Buffer_size);
|
|
|
|
GENODE_RPC(Rpc_pause, void, pause, Subject_id);
|
|
|
|
GENODE_RPC(Rpc_resume, void, resume, Subject_id);
|
|
|
|
GENODE_RPC(Rpc_subjects, Subjects_rpc_result, subjects);
|
|
|
|
GENODE_RPC(Rpc_subject_infos, Infos_rpc_result, subject_infos);
|
|
|
|
GENODE_RPC(Rpc_buffer, Dataspace_capability, buffer, Subject_id);
|
|
|
|
GENODE_RPC(Rpc_free, void, free, Subject_id);
|
2013-08-10 01:44:55 +00:00
|
|
|
|
2016-05-11 15:23:51 +00:00
|
|
|
GENODE_RPC_INTERFACE(Rpc_dataspace, Rpc_alloc_policy, Rpc_policy,
|
2022-09-29 14:50:47 +00:00
|
|
|
Rpc_unload_policy, Rpc_trace, Rpc_pause,
|
2021-12-15 16:19:10 +00:00
|
|
|
Rpc_resume, Rpc_subjects, Rpc_buffer,
|
2020-01-16 17:00:30 +00:00
|
|
|
Rpc_free, Rpc_subject_infos);
|
2013-08-10 01:44:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__TRACE_SESSION__TRACE_SESSION_H_ */
|