2023-02-27 13:40:20 +01:00
|
|
|
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
|
2022-09-19 12:39:02 +02:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
2022-08-23 16:40:44 +02:00
|
|
|
|
2022-08-25 18:56:55 +02:00
|
|
|
#ifndef INSTR_NANOS6_H
|
|
|
|
#define INSTR_NANOS6_H
|
2022-08-23 16:40:44 +02:00
|
|
|
|
2023-03-22 16:01:55 +01:00
|
|
|
#include "instr.h"
|
2022-08-23 16:40:44 +02:00
|
|
|
|
2023-02-24 16:53:02 +01:00
|
|
|
#include "task.h"
|
|
|
|
|
|
|
|
static inline uint32_t
|
2022-08-23 16:40:44 +02:00
|
|
|
instr_nanos6_type_create(int32_t typeid)
|
|
|
|
{
|
|
|
|
struct ovni_ev ev = {0};
|
|
|
|
|
|
|
|
ovni_ev_set_mcv(&ev, "6Yc");
|
2023-02-24 11:55:54 +01:00
|
|
|
ovni_ev_set_clock(&ev, get_clock());
|
2022-08-23 16:40:44 +02:00
|
|
|
|
|
|
|
char buf[256];
|
|
|
|
char *p = buf;
|
|
|
|
|
|
|
|
size_t nbytes = 0;
|
|
|
|
memcpy(buf, &typeid, sizeof(typeid));
|
|
|
|
p += sizeof(typeid);
|
|
|
|
nbytes += sizeof(typeid);
|
|
|
|
sprintf(p, "testtype%d", typeid);
|
|
|
|
nbytes += strlen(p) + 1;
|
|
|
|
|
|
|
|
ovni_ev_jumbo_emit(&ev, (uint8_t *) buf, nbytes);
|
2023-02-24 16:53:02 +01:00
|
|
|
|
|
|
|
return task_get_type_gid(p);
|
2022-08-23 16:40:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
INSTR_2ARG(instr_nanos6_task_create, "6Tc", int32_t, id, uint32_t, typeid)
|
|
|
|
INSTR_1ARG(instr_nanos6_task_execute, "6Tx", int32_t, id)
|
2022-09-01 17:02:02 +02:00
|
|
|
INSTR_1ARG(instr_nanos6_task_pause, "6Tp", int32_t, id)
|
|
|
|
INSTR_1ARG(instr_nanos6_task_resume, "6Tr", int32_t, id)
|
|
|
|
INSTR_1ARG(instr_nanos6_task_end, "6Te", int32_t, id)
|
2022-08-23 16:40:44 +02:00
|
|
|
|
2022-09-29 15:34:44 +02:00
|
|
|
INSTR_0ARG(instr_nanos6_task_create_begin, "6C[")
|
|
|
|
INSTR_0ARG(instr_nanos6_task_create_end, "6C]")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_sched_server_enter, "6S[")
|
|
|
|
INSTR_0ARG(instr_nanos6_sched_server_exit, "6S]")
|
|
|
|
INSTR_0ARG(instr_nanos6_add_ready_enter, "6Sa")
|
|
|
|
INSTR_0ARG(instr_nanos6_add_ready_exit, "6SA")
|
|
|
|
INSTR_0ARG(instr_nanos6_process_ready_enter, "6Sp")
|
|
|
|
INSTR_0ARG(instr_nanos6_process_ready_exit, "6SP")
|
|
|
|
INSTR_0ARG(instr_nanos6_sched_receive, "6Sr")
|
|
|
|
INSTR_0ARG(instr_nanos6_sched_assign, "6Ss")
|
|
|
|
INSTR_0ARG(instr_nanos6_sched_self_assign, "6S@")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_worker_loop_enter, "6W[")
|
|
|
|
INSTR_0ARG(instr_nanos6_worker_loop_exit, "6W]")
|
|
|
|
INSTR_0ARG(instr_nanos6_handle_task_enter, "6Wt")
|
|
|
|
INSTR_0ARG(instr_nanos6_handle_task_exit, "6WT")
|
|
|
|
INSTR_0ARG(instr_nanos6_switch_to_enter, "6Ww")
|
|
|
|
INSTR_0ARG(instr_nanos6_switch_to_exit, "6WW")
|
|
|
|
INSTR_0ARG(instr_nanos6_migrate_enter, "6Wm")
|
|
|
|
INSTR_0ARG(instr_nanos6_migrate_exit, "6WM")
|
|
|
|
INSTR_0ARG(instr_nanos6_suspend_enter, "6Ws")
|
|
|
|
INSTR_0ARG(instr_nanos6_suspend_exit, "6WS")
|
|
|
|
INSTR_0ARG(instr_nanos6_resume_enter, "6Wr")
|
|
|
|
INSTR_0ARG(instr_nanos6_resume_exit, "6WR")
|
2023-04-11 20:18:18 +02:00
|
|
|
INSTR_0ARG(instr_nanos6_sponge_enter, "6Wg")
|
|
|
|
INSTR_0ARG(instr_nanos6_sponge_exit, "6WG")
|
2022-09-29 15:34:44 +02:00
|
|
|
INSTR_0ARG(instr_nanos6_signal, "6W*")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_submit_task_enter, "6U[")
|
|
|
|
INSTR_0ARG(instr_nanos6_submit_task_exit, "6U]")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_spawn_function_enter, "6F[")
|
|
|
|
INSTR_0ARG(instr_nanos6_spawn_function_exit, "6F]")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_taskfor_start, "6O[")
|
|
|
|
INSTR_0ARG(instr_nanos6_taskfor_stop, "6O]")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_task_body_enter, "6t[")
|
|
|
|
INSTR_0ARG(instr_nanos6_task_body_exit, "6t]")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_register_enter, "6Dr")
|
|
|
|
INSTR_0ARG(instr_nanos6_register_exit, "6DR")
|
|
|
|
INSTR_0ARG(instr_nanos6_unregister_enter, "6Du")
|
|
|
|
INSTR_0ARG(instr_nanos6_unregister_exit, "6DU")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_block_enter, "6Bb")
|
|
|
|
INSTR_0ARG(instr_nanos6_block_exit, "6BB")
|
|
|
|
INSTR_0ARG(instr_nanos6_unblock_enter, "6Bb")
|
|
|
|
INSTR_0ARG(instr_nanos6_unblock_exit, "6BB")
|
|
|
|
INSTR_0ARG(instr_nanos6_taskwait_enter, "6Bw")
|
|
|
|
INSTR_0ARG(instr_nanos6_taskwait_exit, "6BW")
|
|
|
|
INSTR_0ARG(instr_nanos6_waitfor_enter, "6Bf")
|
|
|
|
INSTR_0ARG(instr_nanos6_waitfor_exit, "6BF")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_external_set, "6He")
|
|
|
|
INSTR_0ARG(instr_nanos6_external_unset, "6HE")
|
|
|
|
INSTR_0ARG(instr_nanos6_worker_set, "6Hw")
|
|
|
|
INSTR_0ARG(instr_nanos6_worker_unset, "6HW")
|
|
|
|
INSTR_0ARG(instr_nanos6_leader_set, "6Hl")
|
|
|
|
INSTR_0ARG(instr_nanos6_leader_unset, "6HL")
|
|
|
|
INSTR_0ARG(instr_nanos6_main_set, "6Hm")
|
|
|
|
INSTR_0ARG(instr_nanos6_main_unset, "6HM")
|
|
|
|
|
|
|
|
INSTR_0ARG(instr_nanos6_alloc_enter, "6Ma")
|
|
|
|
INSTR_0ARG(instr_nanos6_alloc_exit, "6MA")
|
|
|
|
INSTR_0ARG(instr_nanos6_free_enter, "6Mf")
|
|
|
|
INSTR_0ARG(instr_nanos6_free_exit, "6MF")
|
2022-09-20 10:30:36 +02:00
|
|
|
|
2022-08-23 16:40:44 +02:00
|
|
|
static inline void
|
|
|
|
instr_nanos6_task_create_and_execute(int32_t id, uint32_t typeid)
|
|
|
|
{
|
2022-09-12 16:52:27 +02:00
|
|
|
instr_nanos6_task_create_begin();
|
2022-08-23 16:40:44 +02:00
|
|
|
instr_nanos6_task_create(id, typeid);
|
|
|
|
instr_nanos6_task_create_end();
|
2022-09-21 17:31:28 +02:00
|
|
|
instr_nanos6_task_body_enter();
|
2022-08-23 16:40:44 +02:00
|
|
|
instr_nanos6_task_execute(id);
|
|
|
|
}
|
|
|
|
|
2022-08-25 18:56:55 +02:00
|
|
|
#endif /* INSTR_NANOS6_H */
|