Commit Graph

396 Commits

Author SHA1 Message Date
439b716a71 Use int64_t printf formats for mark channels 2024-07-24 16:09:47 +02:00
093c91521a Fix error format strings in mark API 2024-07-24 16:09:44 +02:00
3d8c84e17c Fix heap when size_t is not unsigned long long
When the width of size_t doesn't match the width of the unsigned long
long type, the number of leading zeros doesn't match, making the
heap_get_move() function return incorrect values. This is the case on
ARMv7 with 32 bits, where size_t is 32 bits but unsigned long long is 64
bits.

We check the size of size_t to select which builtin we need. The sizeof
operator cannot be used at preprocessing, so we rely on the
optimizations to only leave the proper assembly instruction.

Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/193
2024-07-24 15:12:09 +02:00
129020e1c5 Fix format errors in printf-like functions 2024-07-24 15:12:09 +02:00
d03fe10be8 Protect printf-like calls against format errors 2024-07-24 15:12:09 +02:00
3fdbb95080 Fix remaining problems for 32 bits architectures 2024-07-24 15:12:09 +02:00
Miquel Vidal i Pinyol
3103018404 Use format macro constants for fprintf and fscanf family functions 2024-07-24 15:12:09 +02:00
Miquel Vidal i Pinyol
478ed1f5d0 Use proper format specifiers
Allows compiling for architectures with different data type sizes
2024-07-24 15:12:09 +02:00
5448b5c0ec Check duplicated mark channel types are the same
Ensure that two threads cannot define the same mark type with different
channel types.
2024-07-23 10:35:08 +02:00
be45235d15 Improve documentation of the mark API 2024-07-23 10:35:08 +02:00
87e4b829c5 Switch the mark tracking for threads to active
In the thread view, the values will still be visible when the thread
goes to Warming or Cooling states, instead of being removed like when
the thread enters the Paused state. The CPU view will continue to track
the running thread (only in the Running state).
2024-07-23 10:35:02 +02:00
fbb78ae22d Avoid initialization of mark channels without types
There is no need to create any channel or connect any channel to the PRV
output.
2024-07-22 16:42:23 +02:00
49cecb798a Don't allow zero in PRV for mark channels
As the zero value is not allowed to reach the mark channels, there is no
need to allow it in the PRV end.
2024-06-21 09:39:32 +02:00
d6a83a0520 Allow duplicate values in mark channels 2024-06-20 11:41:38 +02:00
c803a7566f Prevent zero values in the mark API
These values cannot be differentiated from a null value, due to a
Paraver limitation.
2024-06-20 11:41:09 +02:00
a58b3d194c Add CPU output for mark channels
By default they are configured to track the running thread.
2024-06-19 13:48:18 +02:00
d9180d950b Make mark thread channels show only when running
Implements support for tracking the running thread using the track API.
2024-06-19 13:15:16 +02:00
db57136f1b Allow the value zero in marks
When using the mark API to track a counter, it is posible that the value
zero is being emitted as it will be properly displayed using the
gradient view in Paraver.
2024-06-19 12:26:35 +02:00
2c111fd98c Add ovni_mark_set() to the API
Allows emitting a single event to change the value of the mark channel.
The mark type must be defined as single without the MARK_FLAG_STACK
flag.
2024-06-19 12:26:35 +02:00
90f8ae4188 Allow marks without labels defined
The labels are optional, so they shouldn't be required when processing
the mark types.
2024-06-19 12:26:35 +02:00
b4d445b378 Write mark PCF types for thread PVT 2024-06-19 12:26:35 +02:00
ea79c90c89 Connect mark channels to PRV
There must be one channel per thread and type.
2024-06-19 12:26:35 +02:00
1b2f72cc3a Store mark labels into a hash table
Multiple threads can define the same values as long as the labels match.
They will be combined into a single hash table by value.
2024-06-19 12:26:35 +02:00
505245d54c Implement emulator logic to parse mark metadata
The marks are parsed from the metadata definition, then merged from all
threads and a new channel for each mark type is created. The channel
type is specified using a flag when calling ovni_mark_type(), so the
channels is set to single or stack. For now, only ovni_mark_push() and
ovni_mark_pop() are implemented.
2024-06-19 12:26:35 +02:00
93ab5a5833 Add ovni_mark_* API to store custom states
In order to allow easy debugging of some programs and runtimes, it is
often neccessary to add extra information in the timeline views. The
modification of the emulator to accomodate those temporal events is time
consuming and requires knowlegde of the emulator internals.

To improve the situation, a new set of functions are added to libovni
which allow users to define their own views. Up to 100 types of events
can be declared, where each type can have an unlimited number ov values
with an optional label attached.
2024-06-19 12:26:35 +02:00
247ea7e7c3 Add nosv.can_breakdown attribute check
The nosv.can_breakdown attribute states if enough events for the
breakdown model of nOS-V are enabled at runtime. It is used to ensure
that breakdown traces have the progress events enabled along with others
required for proper visualization of traces.

The emulator will panic when the level is not enough, instead of relying
on users to always remember to enable the correct level.
2024-06-18 12:06:42 +02:00
d1e8a62396 Add API to manage metadata in streams
The ovni_attr_* set of functions allows users to write and read metadata
stores in the thread stream. The metadata information is available to
the emulator at the beginning of the emulation.
2024-06-13 11:09:40 +02:00
31d6eb076c Add unknown subsystem state for nOS-V breakdown
It will appear when the emulator knows that a thread is running in the
CPU, but no subsystem has been entered yet. This is common a
instrumentation level lower than 3 in nOS-V.
2024-06-12 16:52:30 +02:00
bb5e406af3 Set a default value for empty task type labels 2024-06-12 16:52:30 +02:00
9d94189165 Increase nOS-V model version to 2.2.0
The new progressing state events VP{pra} cause a minor version bump in
the nOS-V model.
2024-06-12 10:25:24 +02:00
David Alvarez
9fb53df45d nOS-V Breakdown 2024-06-12 10:15:59 +02:00
92cc779caf Make chan_pop() error more clear
Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/188
2024-06-11 09:19:35 +02:00
014152fc89 Fix warning with gcc 11.3.1
All checks were successful
CI / build:debug (pull_request) Successful in 1m20s
CI / build:compilers (pull_request) Successful in 1m35s
CI / build:nompi (pull_request) Successful in 1m40s
CI / build:local (pull_request) Successful in 1m48s
CI / build:rt (pull_request) Successful in 1m54s
CI / build:asan (pull_request) Successful in 2m20s
CI / build:rt (push) Successful in 13s
CI / build:debug (push) Successful in 13s
CI / build:asan (push) Successful in 13s
CI / build:nompi (push) Successful in 13s
CI / build:local (push) Successful in 21s
CI / build:compilers (push) Successful in 20s
Reported-by: Kevin Sala <kevin.sala@bsc.es>
2024-05-10 15:25:23 +02:00
3a300c816e Fix breakdown model forbidden value 0 error
All checks were successful
CI / build:local (pull_request) Successful in 2m4s
CI / build:debug (pull_request) Successful in 1m7s
CI / build:rt (pull_request) Successful in 2m32s
CI / build:compilers (pull_request) Successful in 1m12s
CI / build:nompi (pull_request) Successful in 1m17s
CI / build:asan (pull_request) Successful in 2m7s
CI / build:debug (push) Successful in 3s
CI / build:asan (push) Successful in 3s
CI / build:rt (push) Successful in 13s
CI / build:nompi (push) Successful in 12s
CI / build:local (push) Successful in 21s
CI / build:compilers (push) Successful in 20s
When a event causes a new value in the sort module, the first time it
will write all output values, which most of them will be zero. Writting
a zero value is forbidden by default, so we relax the constraint with
the PRV_ZERO flag.
2024-05-09 15:36:58 +02:00
eb1fc0f7da Add nosv barrier API event 2024-03-22 16:58:14 +01:00
aaa7769448 Add nosv mutex API events 2024-03-22 16:56:25 +01:00
6aff4388eb Panic on events when the thread is preempted
When the thread is not running on the CPU it shouldn't be able to emit
events. A new emulation test ensures the emulation fails if it happens.
2024-03-20 15:55:43 +01:00
31fa1508f7 Mark threads out of CPU by kernel events 2024-03-20 15:50:46 +01:00
d1312ff6e9 Fix definitions for kernel context switch events 2024-03-20 12:27:47 +01:00
31c3c965c7 Increase Nanos6 model minor version
As Nanos6 now emits pause events for the parent task before nesting
another one, we increase the minor so the old emulator rejects new
traces that come with the new pause events.
2024-03-14 14:43:05 +01:00
50837d6173 Port Nanos6 model to tasks with bodies
For now we still allow Nanos6 to use the relaxed nest model, so a nested
task can begin the execution without the parent being paused.
2024-03-13 17:07:32 +01:00
815633221d Port nOS-V model to task bodies
The nOS-V events are modified in two ways: 1) to create a parallel task
the new VTC event must be used and 2) all task events for both normal
(VTc) and parallel (VTC) tasks require an extra argument in the payload
to indicate the body id. As a consequence, the nOS-V model version is
now increased to 2.0.0.

Additionally, all the channel PRV flags are set to PRV_SKIPDUPNULL, so
duplicates are only emitted if they are not null. It solves the problem
when a task switches to another task with the same body id.

A new Paraver configuration is added for the body id.
2024-03-13 17:07:26 +01:00
27a23f25ca Update task model to use bodies
The task model is now integrated with the body model. A normal task can
only have one body, while a parallel task can have more.

It inherits the restriction that a task body cannot be nested over
another one unless it is paused (or the relaxed nest model is enabled).
2024-03-12 12:37:58 +01:00
a0e7fad83e Add body model for tasks
The new task body model (or just body model) allows a task to have
multiple bodies. Generally a body is mapped to the execution of the same
user code of the task with specific input arguments.

The body model can constraint if a given body can be paused or re-run
again (resurrect).

Additionally, the body model can run multiple nested bodies but with the
restriction that the parent body should be paused first. This condition
can be relaxed with the BODY_FLAG_RELAX_NESTING flag.
2024-03-12 12:37:09 +01:00
bdd5696641 Add PRV_SKIPDUPNULL flag
This flag allows to only skip duplicates if the value is null, otherwise
the value is emitted. Invalid combinations of PRV_* flags are also
checked on prv_register().
2024-03-12 12:37:09 +01:00
55318d9da7 Update OpenMP emulation model
Add more tests, subsystem states and documentation.
2024-03-12 11:35:18 +01:00
Raúl Peñacoba Veigas
bf2b3b73a0 Add OpenMP emulation model
For now it only has support for subsystems

Co-authored-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-03-08 13:04:45 +01:00
454504d0cc Poison usleep()
It has been deprecated in POSIX.1-2001 and removed in POSIX.1-2008.
2024-02-20 14:01:18 +01:00
4993197fb9 Add nOS-V attach and detach API events
Instead of showing the "attached" state with the VH{aA} events, we show
when the call to nosv_attach() and nosv_detach() take place. The old
VH{aA} events are now ignored. Bumps the nOS-V model version to 1.1.0.
2024-02-15 17:59:41 +01:00
68fc8b0eba Encode ovnievents output for HTML 2024-01-30 12:02:02 +01:00