genode/repos/base/include/base/trace
Johannes Schlatow 9fc3344ee8 trace/buffer: keep "last" entry on wraps
When the former trace buffer implementation wrapped, the last entry
according to commit order couldn't be detected anymore. Now, the last
committed entry is always followed by an entry with length 0.

As a downside of this, there are now two meanings of "last" entry: It
means either that the entry marks the empty padding after the entry with
the highest memory address or that it actually marks the end of the
buffer according to commit order. This is an example state of the buffer
with the two types of "last" entry:

                           last                                     last
+-------------+------------+---+---------+-------------+------------+---+-------+
| len3  data3 | len4 data4 | 0 | empty   | len1  data1 | len2 data2 | 0 | empty |
+-------------+------------+---+---------+-------------+------------+---+-------+

If the entry with the highest memory address fits perfectly, the first
type of "last" entry is not needed:

                                  last
+------------+--------------------+---+-------+-------------+-------------------+
| len3 data3 | len4         data4 | 0 | empty | len1  data1 | len2        data2 |
+------------+--------------------+---+-------+-------------+-------------------+

If the buffer didn't wrap so far, there is only one "last" entry that
has both meanings:

                                                      last
+--------------------------+------------+-------------+---+---------------------+
| len1               data1 | len2 data2 | len3  data3 | 0 | empty               |
+--------------------------+------------+-------------+---+---------------------+

Issue #2735

Co-authored-by: Martin Stein <martin.stein@genode-labs.com>
2018-05-03 15:31:54 +02:00
..
buffer.h trace/buffer: keep "last" entry on wraps 2018-05-03 15:31:54 +02:00
events.h Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
logger.h Follow practices suggested by "Effective C++" 2018-01-17 12:14:35 +01:00
policy.h Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
types.h Follow practices suggested by "Effective C++" 2018-01-17 12:14:35 +01:00