[npubinfmt/profile] Add decription of extended metadata for profiling
authorDongju Chae <dongju.chae@samsung.com>
Tue, 12 Jan 2021 03:32:01 +0000 (12:32 +0900)
committer채동주/On-Device Lab(SR)/Staff Engineer/삼성전자 <dongju.chae@samsung.com>
Thu, 14 Jan 2021 03:29:02 +0000 (12:29 +0900)
This patch adds some description of extended metadata for profiling.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
include/common/npubinfmt.h

index 2d86dbc..0fcf85e 100644 (file)
@@ -235,6 +235,22 @@ typedef struct {
   char reserved_extended[];     /**< Reserved for future; zero-length array */
 } __attribute__((packed, aligned)) npubin_meta;
 
+/**
+ * @brief Extended metadata for profiling (obtained from a compiler)
+ */
+typedef struct {
+  uint32_t total_size;  /**< actual size of extended metadata, not 4K-multiplied one */
+  uint32_t entry_num;   /**< total number of entries (i.e., number of vISA insts) */
+  /**
+   * The below shows each entry's data format (little endian).
+   * - [ vISA ID : 4Bytes ][ length : 4Bytes ][ data : 'length' Bytes ]
+   *
+   * If 'data' is string type, it should be null-terminated and its 'length' includes it.
+   * Note that when 'length' is zero, the following 'data' is empty.
+   */
+  char entry_data[];
+} __attribute__((packed, aligned)) npubin_meta_profile;
+
 /* Compile-time assert. From http://www.pixelbeat.org/programming/gcc/static_assert.html */
 #define ASSERT_CONCAT_(a, b) a##b
 #define ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b)