Skip to content

Commit a0b7a3e

Browse files
authored
Use Int64 raw counter values (#9)
1 parent 6dcc483 commit a0b7a3e

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Native~/streamline_annotate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,14 +1063,14 @@ void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API gator_annotate_counter(const uin
10631063
return;
10641064
}
10651065

1066-
void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API gator_annotate_counter_value(const uint32_t core, const uint32_t id, const uint32_t value)
1066+
void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API gator_annotate_counter_value(const uint32_t core, const uint32_t id, const int64_t value)
10671067
{
10681068
struct gator_thread *const thread = gator_get_thread();
10691069
if (thread == NULL) {
10701070
return;
10711071
}
10721072

1073-
gator_buf_wait_bytes(thread, 1 + sizeof(uint32_t) + MAXSIZE_PACK_LONG + 3*MAXSIZE_PACK_INT);
1073+
gator_buf_wait_bytes(thread, 1 + sizeof(uint32_t) + 2 * MAXSIZE_PACK_LONG + 2 * MAXSIZE_PACK_INT);
10741074

10751075
uint32_t write_pos;
10761076
uint32_t size_pos;
@@ -1080,7 +1080,7 @@ void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API gator_annotate_counter_value(con
10801080
length += gator_buf_write_time(thread->buf, &write_pos);
10811081
length += gator_buf_write_int(thread->buf, &write_pos, core);
10821082
length += gator_buf_write_int(thread->buf, &write_pos, id);
1083-
length += gator_buf_write_int(thread->buf, &write_pos, value);
1083+
length += gator_buf_write_long(thread->buf, &write_pos, value);
10841084

10851085
gator_msg_end(thread, write_pos, size_pos, length);
10861086
}

Native~/streamline_annotate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* SPDX-License-Identifier: BSD-3-Clause
33
*
4-
* Copyright (c) 2014-2021, Arm Limited
4+
* Copyright (c) 2014-2022, Arm Limited
55
* All rights reserved.
66
*
77
* Redistribution and use in source and binary forms, with or without
@@ -224,7 +224,7 @@ void gator_annotate_visual(const void *const data, const uint32_t length, const
224224
void gator_annotate_marker(const char *const str);
225225
void gator_annotate_marker_color(const uint32_t color, const char *const str);
226226
void gator_annotate_counter(const uint32_t id, const char *const title, const char *const name, const int per_cpu, const enum gator_annotate_counter_class counter_class, const enum gator_annotate_display display, const char *const units, const uint32_t modifier, const enum gator_annotate_series_composition series_composition, const enum gator_annotate_rendering_type rendering_type, const int average_selection, const int average_cores, const int percentage, const size_t activity_count, const char *const *const activities, const uint32_t *const activity_colors, const uint32_t cores, const uint32_t color, const char *const description);
227-
void gator_annotate_counter_value(const uint32_t core, const uint32_t id, const uint32_t value);
227+
void gator_annotate_counter_value(const uint32_t core, const uint32_t id, const int64_t value);
228228
void gator_annotate_activity_switch(const uint32_t core, const uint32_t id, const uint32_t activity, const uint32_t tid);
229229
void gator_cam_track(const uint32_t view_uid, const uint32_t track_uid, const uint32_t parent_track, const char *const name);
230230
void gator_cam_job(const uint32_t view_uid, const uint32_t job_uid, const char *const name, const uint32_t track, const uint64_t start_time, const uint64_t duration, const uint32_t color, const uint32_t primary_dependency, const size_t dependency_count, const uint32_t *const dependencies);
24 Bytes
Binary file not shown.
240 Bytes
Binary file not shown.

Runtime/MobileStudio.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private static extern void gator_annotate_counter(
113113

114114
[DllImport("mobilestudio")]
115115
private static extern void gator_annotate_counter_value(
116-
UInt32 cpu, UInt32 counter_id, UInt32 value);
116+
UInt32 cpu, UInt32 counter_id, Int64 value);
117117

118118
#endif
119119

@@ -265,7 +265,7 @@ public void set_value(float value)
265265
#if UNITY_ANDROID && !UNITY_EDITOR
266266
if (state == AnnotationState.Active)
267267
{
268-
UInt32 ivalue = (UInt32)(value * (float)modifier);
268+
Int64 ivalue = (Int64)(value * (float)modifier);
269269
gator_annotate_counter_value(0, counter, ivalue);
270270
}
271271
#endif

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.arm.mobile-studio",
33
"description": "Unity C# bindings for Mobile Studio.",
4-
"version": "1.3.0",
4+
"version": "1.4.0",
55
"unity": "2020.3",
66
"displayName": "Mobile Studio"
77
}

0 commit comments

Comments
 (0)