Skip to content

Commit

Permalink
Add units to docs of new fields
Browse files Browse the repository at this point in the history
  • Loading branch information
woodfell committed Jan 4, 2024
1 parent b35a36c commit e05062e
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 36 deletions.
9 changes: 5 additions & 4 deletions c/include/libsbp/legacy/profiling.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ SBP_PACK_START
*/

typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
u32 total_time; /**< Total time spent in measurement point */
u32 total_time; /**< Total time spent in measurement point
(microseconds) */
u16 num_executions; /**< Number of times measurement point has executed */
u32 min; /**< Minimum execution time */
u32 max; /**< Maximum execution time */
u32 min; /**< Minimum execution time (microseconds) */
u32 max; /**< Maximum execution time (microseconds) */
u64 return_addr; /**< Return address */
u64 id; /**< Unique ID */
u64 slice_time; /**< CPU slice time */
u64 slice_time; /**< CPU slice time (milliseconds) */
u16 line; /**< Line number */
char func[0]; /**< Function name */
} msg_measurement_point_t;
Expand Down
8 changes: 4 additions & 4 deletions c/include/libsbp/profiling/MSG_MEASUREMENT_POINT.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extern "C" {
*/
typedef struct {
/**
* Total time spent in measurement point
* Total time spent in measurement point (microseconds)
*/
u32 total_time;

Expand All @@ -56,12 +56,12 @@ typedef struct {
u16 num_executions;

/**
* Minimum execution time
* Minimum execution time (microseconds)
*/
u32 min;

/**
* Maximum execution time
* Maximum execution time (microseconds)
*/
u32 max;

Expand All @@ -76,7 +76,7 @@ typedef struct {
u64 id;

/**
* CPU slice time
* CPU slice time (milliseconds)
*/
u64 slice_time;

Expand Down
Binary file modified docs/sbp.pdf
Binary file not shown.
8 changes: 4 additions & 4 deletions haskell/src/SwiftNav/SBP/Profiling.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ msgMeasurementPoint = 0xCF00
-- Swift's engineering teams.
data MsgMeasurementPoint = MsgMeasurementPoint
{ _msgMeasurementPoint_total_time :: !Word32
-- ^ Total time spent in measurement point
-- ^ Total time spent in measurement point (microseconds)
, _msgMeasurementPoint_num_executions :: !Word16
-- ^ Number of times measurement point has executed
, _msgMeasurementPoint_min :: !Word32
-- ^ Minimum execution time
-- ^ Minimum execution time (microseconds)
, _msgMeasurementPoint_max :: !Word32
-- ^ Maximum execution time
-- ^ Maximum execution time (microseconds)
, _msgMeasurementPoint_return_addr :: !Word64
-- ^ Return address
, _msgMeasurementPoint_id :: !Word64
-- ^ Unique ID
, _msgMeasurementPoint_slice_time :: !Word64
-- ^ CPU slice time
-- ^ CPU slice time (milliseconds)
, _msgMeasurementPoint_line :: !Word16
-- ^ Line number
, _msgMeasurementPoint_func :: !Text
Expand Down
8 changes: 4 additions & 4 deletions java/src/com/swiftnav/sbp/profiling/MsgMeasurementPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
public class MsgMeasurementPoint extends SBPMessage {
public static final int TYPE = 0xCF00;

/** Total time spent in measurement point */
/** Total time spent in measurement point (microseconds) */
public long total_time;

/** Number of times measurement point has executed */
public int num_executions;

/** Minimum execution time */
/** Minimum execution time (microseconds) */
public long min;

/** Maximum execution time */
/** Maximum execution time (microseconds) */
public long max;

/** Return address */
Expand All @@ -49,7 +49,7 @@ public class MsgMeasurementPoint extends SBPMessage {
/** Unique ID */
public BigInteger id;

/** CPU slice time */
/** CPU slice time (milliseconds) */
public BigInteger slice_time;

/** Line number */
Expand Down
8 changes: 4 additions & 4 deletions javascript/sbp/profiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ let UInt64 = require('cuint').UINT64;
* engineering teams.
*
* Fields in the SBP payload (`sbp.payload`):
* @field total_time number (unsigned 32-bit int, 4 bytes) Total time spent in measurement point
* @field total_time number (unsigned 32-bit int, 4 bytes) Total time spent in measurement point (microseconds)
* @field num_executions number (unsigned 16-bit int, 2 bytes) Number of times measurement point has executed
* @field min number (unsigned 32-bit int, 4 bytes) Minimum execution time
* @field max number (unsigned 32-bit int, 4 bytes) Maximum execution time
* @field min number (unsigned 32-bit int, 4 bytes) Minimum execution time (microseconds)
* @field max number (unsigned 32-bit int, 4 bytes) Maximum execution time (microseconds)
* @field return_addr number (unsigned 64-bit int, 8 bytes) Return address
* @field id number (unsigned 64-bit int, 8 bytes) Unique ID
* @field slice_time number (unsigned 64-bit int, 8 bytes) CPU slice time
* @field slice_time number (unsigned 64-bit int, 8 bytes) CPU slice time (milliseconds)
* @field line number (unsigned 16-bit int, 2 bytes) Line number
* @field func string Function name
*
Expand Down
8 changes: 4 additions & 4 deletions kaitai/ksy/profiling.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ types:
seq:
- id: total_time
doc: |
Total time spent in measurement point
Total time spent in measurement point (microseconds)
type: u4
- id: num_executions
doc: |
Number of times measurement point has executed
type: u2
- id: min
doc: |
Minimum execution time
Minimum execution time (microseconds)
type: u4
- id: max
doc: |
Maximum execution time
Maximum execution time (microseconds)
type: u4
- id: return_addr
doc: |
Expand All @@ -52,7 +52,7 @@ types:
type: u8
- id: slice_time
doc: |
CPU slice time
CPU slice time (milliseconds)
type: u8
- id: line
doc: |
Expand Down
8 changes: 4 additions & 4 deletions python/sbp/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ class MsgMeasurementPoint(SBP):
sbp : SBP
SBP parent object to inherit from.
total_time : int
Total time spent in measurement point
Total time spent in measurement point (microseconds)
num_executions : int
Number of times measurement point has executed
min : int
Minimum execution time
Minimum execution time (microseconds)
max : int
Maximum execution time
Maximum execution time (microseconds)
return_addr : int
Return address
id : int
Unique ID
slice_time : int
CPU slice time
CPU slice time (milliseconds)
line : int
Line number
func : string
Expand Down
8 changes: 4 additions & 4 deletions rust/sbp/src/messages/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ pub mod msg_measurement_point {
/// The message sender_id
#[cfg_attr(feature = "serde", serde(skip_serializing, alias = "sender"))]
pub sender_id: Option<u16>,
/// Total time spent in measurement point
/// Total time spent in measurement point (microseconds)
#[cfg_attr(feature = "serde", serde(rename = "total_time"))]
pub total_time: u32,
/// Number of times measurement point has executed
#[cfg_attr(feature = "serde", serde(rename = "num_executions"))]
pub num_executions: u16,
/// Minimum execution time
/// Minimum execution time (microseconds)
#[cfg_attr(feature = "serde", serde(rename = "min"))]
pub min: u32,
/// Maximum execution time
/// Maximum execution time (microseconds)
#[cfg_attr(feature = "serde", serde(rename = "max"))]
pub max: u32,
/// Return address
Expand All @@ -52,7 +52,7 @@ pub mod msg_measurement_point {
/// Unique ID
#[cfg_attr(feature = "serde", serde(rename = "id"))]
pub id: u64,
/// CPU slice time
/// CPU slice time (milliseconds)
#[cfg_attr(feature = "serde", serde(rename = "slice_time"))]
pub slice_time: u64,
/// Line number
Expand Down
8 changes: 4 additions & 4 deletions spec/yaml/swiftnav/sbp/profiling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ definitions:
fields:
- total_time:
type: u32
desc: Total time spent in measurement point
desc: Total time spent in measurement point (microseconds)
- num_executions:
type: u16
desc: Number of times measurement point has executed
- min:
type: u32
desc: Minimum execution time
desc: Minimum execution time (microseconds)
- max:
type: u32
desc: Maximum execution time
desc: Maximum execution time (microseconds)
- return_addr:
type: u64
desc: Return address
Expand All @@ -44,7 +44,7 @@ definitions:
desc: Unique ID
- slice_time:
type: u64
desc: CPU slice time
desc: CPU slice time (milliseconds)
- line:
type: u16
desc: Line number
Expand Down

0 comments on commit e05062e

Please sign in to comment.