Skip to content

Commit

Permalink
Add spec and tests for new message
Browse files Browse the repository at this point in the history
  • Loading branch information
woodfell committed Jan 4, 2024
1 parent d9875ec commit 3c4a98d
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
description: Unit tests for swiftnav.sbp.profiling MsgMeasurementPoint
generated_on: 2023-12-08 00:00:00.00 # manually generated
package: sbp.profiling
tests:


- msg:
c_decoded_fields:
func:
handle_as: encoded-string
text: route()
fn_prefix: sbp_msg_measurement_point_func
encoded_len: 8
fields:
total_time: 2042
num_executions: 180
min: 2
max: 40
return_addr: 93877475527042
id: 2496234002
slice_time: 261963842
line: 18
func: "route()\u0000"
module: sbp.profiling
name: MsgMeasurementPoint
msg_type: '0xCF00'
raw_json: '{"crc": 42452, "preamble": 85, "sender": 4096, "length": 48, "msg_type": 52992,
"total_time": 2042, "num_executions": 180, "min": 2, "max": 40,
"return_addr": 93877475527042, "id": 2496234002,
"slice_time": 261963842, "line": 18, "func": "route()\u0000",
"payload": "+gcAALQAAgAAACgAAACCyZSNYVUAABKCyZQAAAAAQkCdDwAAAAASAHJvdXRlKCkA"
}'

raw_packet: VQDPABAw+gcAALQAAgAAACgAAACCyZSNYVUAABKCyZQAAAAAQkCdDwAAAAASAHJvdXRlKCkA1KU=
sbp:
crc: '0xa5d4'
length: 48
msg_type: '0xCF00'
payload: +gcAALQAAgAAACgAAACCyZSNYVUAABKCyZQAAAAAQkCdDwAAAAASAHJvdXRlKCkA
preamble: '0x55'
sender: '0x1000'

54 changes: 54 additions & 0 deletions spec/yaml/swiftnav/sbp/profiling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright (C) 2015-2024 Swift Navigation Inc.
# Contact: https://support.swiftnav.com
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

package: swiftnav.sbp.profiling
description: Standardized profiling messages from Swift Navigation devices.
stable: False
public: False
include:
- types.yaml
definitions:

- MSG_MEASUREMENT_POINT:
id: 0xCF00
short_desc: Profiling Measurement Point
desc: >
Tracks execution time of certain code paths in specially built products.
This message should only be expected and processed on the direction of Swift's
engineering teams.
fields:
- total_time:
type: u32
desc: Total time spent in measurement point
- num_executions:
type: u16
desc: Number of times measurement point has executed
- min:
type: u32
desc: Minimum execution time
- max:
type: u32
desc: Maximum execution time
- return_addr:
type: u64
desc: Return address
- id:
type: u64
desc: Unique ID
- slice_time:
type: u64
desc: CPU slice time
- line:
type: u16
desc: Line number
- func:
type: string
encoding: null_terminated
desc: Function name

0 comments on commit 3c4a98d

Please sign in to comment.