blob: dfcbdf7dd790946ea199fb16954648bd95e7659a [file] [log] [blame]
syntax = "proto2";
package base.sequence_manager;
// Describes the grammar of the fuzzer's test description. At a high level, it
// describes a sequence of actions that can be executed.
message SequenceManagerTestDescription {
// NEXT ID = 2
// This should be consistent with TaskQueue::QueuePriority.
enum QueuePriority {
// NEXT ID = 7
UNDEFINED = 0;
BEST_EFFORT = 1;
LOW = 2;
NORMAL = 3;
HIGH = 4;
VERY_HIGH = 5;
HIGHEST = 6;
CONTROL = 7;
}
message Action {
// NEXT ID = 13
optional uint64 action_id = 1;
oneof action {
CreateTaskQueueAction create_task_queue = 2;
PostDelayedTaskAction post_delayed_task = 3;
SetQueuePriorityAction set_queue_priority = 4;
SetQueueEnabledAction set_queue_enabled = 5;
ShutdownTaskQueueAction shutdown_task_queue = 6;
CancelTaskAction cancel_task = 7;
CreateQueueVoterAction create_queue_voter = 8;
InsertFenceAction insert_fence = 9;
RemoveFenceAction remove_fence = 10;
CreateThreadAction create_thread = 11;
CrossThreadPostDelayedTaskAction cross_thread_post = 12;
}
}
message Task {
// NEXT ID = 4
// Only needed for testing the fuzzer processor.
optional uint64 task_id = 1;
optional uint32 duration_ms = 2;
// If not set, then this is a no-op task.
repeated Action actions = 3;
}
// Describes the grammar of SequenceManager::CreateTaskQueue.
message CreateTaskQueueAction {
// NEXT ID = 2
optional QueuePriority initial_priority = 1;
}
// Describes the grammar of TaskQueue::PostDelayedTask.
message PostDelayedTaskAction {
// NEXT ID = 4
// Used to identify the |task_queue_id|'s oldest available queue to post a
// task to (modulo the number of available queues).
optional uint64 task_queue_id = 1;
optional Task task = 2;
// Delay parameter passed to TaskQueue::PostDelayedTask.
optional uint32 delay_ms = 3;
}
message CrossThreadPostDelayedTaskAction {
// NEXT ID = 5
// Used to identify the |thread_id|'s created thread.
required uint64 thread_id = 1;
// Used to identify the |task_queue_id|'s oldest available queue in the
// thread identified by |thread_id| to post a task to (modulo the number of
// available queues).
optional uint64 task_queue_id = 2;
optional Task task = 3;
// Delay parameter passed to TaskQueue::PostDelayedTask.
optional uint32 delay_ms = 4;
}
// Describes the grammar of TaskQueue::SetQueuePriority.
message SetQueuePriorityAction {
// NEXT ID = 3
// Used to identify the |task_queue_id|'s oldest available queue (modulo the
// number of available queues).
optional uint64 task_queue_id = 1;
optional QueuePriority priority = 2;
}
// Describes the grammar of TaskQueue::CreateQueueEnabledVoter.
message CreateQueueVoterAction {
// NEXT_ID = 2
// Used to identify the |task_queue_id|'s oldest available queue to
// create a voter for (modulo the number of available queues).
optional uint64 task_queue_id = 1;
}
// Describes the grammar of TaskQueue::SetQueueEnabled.
message SetQueueEnabledAction {
// NEXT ID = 4
// Used to identify the |task_queue_id|'s oldest available queue to
// enable/disable (modulo the number of available queues).
optional uint64 task_queue_id = 1;
// Used to identify the |voter_id|'s oldest available voter (modulo the
// number of available voters).
optional uint64 voter_id = 2;
optional bool enabled = 3 [default = true];
}
// Describes the grammar of TaskQueue::ShutDownTaskQueue
message ShutdownTaskQueueAction {
// NEXT ID = 2
// Used to identify the |task_queue_id|'s oldest available queue to shutdown
// (modulo the number of available queues).
optional uint64 task_queue_id = 1;
}
message CancelTaskAction {
// NEXT ID = 2
// Used to identify the |task_id|'s oldest pending task to cancel (modulo
// the number of pending tasks).
optional uint64 task_id = 1;
}
message InsertFenceAction {
// NEXT ID = 3
enum FencePosition {
NOW = 0;
BEGINNING_OF_TIME = 1;
}
optional FencePosition position = 1 [default = NOW];
// Used to identify the |task_queue_id|'s oldest available queue to
// insert the fence to (modulo the number of available queues).
optional uint64 task_queue_id = 2;
}
message RemoveFenceAction {
// NEXT ID = 2
// Used to identify the |task_queue_id|'s oldest available queue to remove a
// fence from, if one exists (modulo the number of available queues).
optional uint64 task_queue_id = 2;
}
message CreateThreadAction {
// NEXT ID = 2
repeated Action initial_thread_actions = 1;
}
message CreateInitialThreadAction {
// NEXT ID = 3
optional uint64 action_id = 1;
required CreateThreadAction create_thread = 2;
}
repeated CreateInitialThreadAction main_thread_actions = 1;
}