Skip to content

Commit 2f7afb0

Browse files
committed
Update on "[devtool] make ETDumpGen use datasink"
This diff enables customized debug data pipeline by making ETDumpGen leverage user-provided datasink. Details can be found in https://docs.google.com/document/d/1y_m32mKdj-OgLcLUz9TKhBW3PC3bBDYSBbeAH544EfM/edit?tab=t.0#heading=h.jlkcrurw482r Differential Revision: [D69647096](https://our.internmc.facebook.com/intern/diff/D69647096/) [ghstack-poisoned]
2 parents a25d258 + a6f6d36 commit 2f7afb0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

devtools/etdump/buffer_data_sink.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class BufferDataSink : public DataSinkBase {
2929
* @param[in] buffer A Span object representing the buffer where data will be
3030
* stored.
3131
* @param[in] alignment The alignment requirement for the buffer. It must be
32-
* a power of two. Default is 64.
32+
* a power of two and greater than zero. Default is 64.
3333
*/
3434
explicit BufferDataSink(
3535
::executorch::runtime::Span<uint8_t> buffer,
@@ -42,6 +42,8 @@ class BufferDataSink : public DataSinkBase {
4242
*
4343
* @param[in] ptr A pointer to the data blob where data will be stored.
4444
* @param[in] size The size of the data blob in bytes.
45+
* @param[in] alignment The alignment requirement for the buffer. It must be
46+
* a power of two and greater than zero. Default is 64.
4547
*/
4648
BufferDataSink(void* ptr, size_t size, size_t alignment = 64)
4749
: debug_buffer_((uint8_t*)ptr, size), offset_(0), alignment_(alignment) {}

devtools/etdump/utils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ namespace internal {
1313
* Aligns a pointer to the next multiple of `alignment`.
1414
*
1515
* @param[in] ptr Pointer to align.
16-
* @param[in] alignment Alignment to align to. Must be a power of 2.
16+
* @param[in] alignment Alignment to align to. Must be a power of 2 and cannot
17+
* be 0.
1718
*
1819
* @returns A pointer aligned to `alignment`.
1920
*/

0 commit comments

Comments
 (0)