Skip to content

Commit

Permalink
Use Int64 raw counter values (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
solidpixel authored Aug 15, 2022
1 parent 6dcc483 commit a0b7a3e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Native~/streamline_annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,14 +1063,14 @@ void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API gator_annotate_counter(const uin
return;
}

void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API gator_annotate_counter_value(const uint32_t core, const uint32_t id, const uint32_t value)
void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API gator_annotate_counter_value(const uint32_t core, const uint32_t id, const int64_t value)
{
struct gator_thread *const thread = gator_get_thread();
if (thread == NULL) {
return;
}

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

uint32_t write_pos;
uint32_t size_pos;
Expand All @@ -1080,7 +1080,7 @@ void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API gator_annotate_counter_value(con
length += gator_buf_write_time(thread->buf, &write_pos);
length += gator_buf_write_int(thread->buf, &write_pos, core);
length += gator_buf_write_int(thread->buf, &write_pos, id);
length += gator_buf_write_int(thread->buf, &write_pos, value);
length += gator_buf_write_long(thread->buf, &write_pos, value);

gator_msg_end(thread, write_pos, size_pos, length);
}
Expand Down
4 changes: 2 additions & 2 deletions Native~/streamline_annotate.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 2014-2021, Arm Limited
* Copyright (c) 2014-2022, Arm Limited
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -224,7 +224,7 @@ void gator_annotate_visual(const void *const data, const uint32_t length, const
void gator_annotate_marker(const char *const str);
void gator_annotate_marker_color(const uint32_t color, const char *const str);
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);
void gator_annotate_counter_value(const uint32_t core, const uint32_t id, const uint32_t value);
void gator_annotate_counter_value(const uint32_t core, const uint32_t id, const int64_t value);
void gator_annotate_activity_switch(const uint32_t core, const uint32_t id, const uint32_t activity, const uint32_t tid);
void gator_cam_track(const uint32_t view_uid, const uint32_t track_uid, const uint32_t parent_track, const char *const name);
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);
Expand Down
Binary file modified Plugins/arm64-v8a/libmobilestudio.so
Binary file not shown.
Binary file modified Plugins/armeabi-v7a/libmobilestudio.so
Binary file not shown.
4 changes: 2 additions & 2 deletions Runtime/MobileStudio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private static extern void gator_annotate_counter(

[DllImport("mobilestudio")]
private static extern void gator_annotate_counter_value(
UInt32 cpu, UInt32 counter_id, UInt32 value);
UInt32 cpu, UInt32 counter_id, Int64 value);

#endif

Expand Down Expand Up @@ -265,7 +265,7 @@ public void set_value(float value)
#if UNITY_ANDROID && !UNITY_EDITOR
if (state == AnnotationState.Active)
{
UInt32 ivalue = (UInt32)(value * (float)modifier);
Int64 ivalue = (Int64)(value * (float)modifier);
gator_annotate_counter_value(0, counter, ivalue);
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.arm.mobile-studio",
"description": "Unity C# bindings for Mobile Studio.",
"version": "1.3.0",
"version": "1.4.0",
"unity": "2020.3",
"displayName": "Mobile Studio"
}

0 comments on commit a0b7a3e

Please sign in to comment.