diff options
| -rw-r--r-- | meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch | 45 | ||||
| -rw-r--r-- | meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb | 1 |
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch b/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch new file mode 100644 index 0000000000..7a8813e968 --- /dev/null +++ b/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | From 09505532b49573663fb4ff4dad424dc2ef4c1f84 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Kyle Russell <bkylerussell@gmail.com> | ||
| 3 | Date: Wed, 13 Jul 2016 17:30:00 -0400 | ||
| 4 | Subject: [PATCH] collector: Allocate space on heap for chunks | ||
| 5 | |||
| 6 | Nicer for embedded devices which may have smaller stack limitations. | ||
| 7 | |||
| 8 | Upstream-Status: Submitted [https://github.com/xrmx/bootchart/pull/74] | ||
| 9 | |||
| 10 | Signed-off-by: Kyle Russell <bkylerussell@gmail.com> | ||
| 11 | --- | ||
| 12 | collector/dump.c | 7 ++++--- | ||
| 13 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/collector/dump.c b/collector/dump.c | ||
| 16 | index e673b5b..2f094b4 100644 | ||
| 17 | --- a/collector/dump.c | ||
| 18 | +++ b/collector/dump.c | ||
| 19 | @@ -184,12 +184,12 @@ static void dump_buffers (DumpState *s) | ||
| 20 | log ("reading %d chunks (of %d) ...\n", max_chunk, s->map.max_chunk); | ||
| 21 | for (i = 0; i < max_chunk; i++) { | ||
| 22 | FILE *output; | ||
| 23 | - char buffer[CHUNK_SIZE]; | ||
| 24 | - Chunk *c = (Chunk *)&buffer; | ||
| 25 | + char *buffer = malloc(CHUNK_SIZE); | ||
| 26 | + Chunk *c = (Chunk *)buffer; | ||
| 27 | size_t addr = (size_t) s->map.chunks[i]; | ||
| 28 | |||
| 29 | lseek (s->mem, addr, SEEK_SET); | ||
| 30 | - read (s->mem, &buffer, CHUNK_SIZE); | ||
| 31 | + read (s->mem, buffer, CHUNK_SIZE); | ||
| 32 | /* log ("type: '%s' len %d\n", | ||
| 33 | c->dest_stream, (int)c->length); */ | ||
| 34 | |||
| 35 | @@ -197,6 +197,7 @@ static void dump_buffers (DumpState *s) | ||
| 36 | fwrite (c->data, 1, c->length, output); | ||
| 37 | bytes_dumped += c->length; | ||
| 38 | fclose (output); | ||
| 39 | + free(buffer); | ||
| 40 | } | ||
| 41 | log ("wrote %ld kb\n", (long)(bytes_dumped+1023)/1024); | ||
| 42 | } | ||
| 43 | -- | ||
| 44 | 2.7.4 | ||
| 45 | |||
diff --git a/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb b/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb index fdebb6419c..4f01734bb0 100644 --- a/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb +++ b/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb | |||
| @@ -93,6 +93,7 @@ UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)" | |||
| 93 | SRC_URI = "git://github.com/mmeeks/bootchart.git \ | 93 | SRC_URI = "git://github.com/mmeeks/bootchart.git \ |
| 94 | file://bootchartd_stop.sh \ | 94 | file://bootchartd_stop.sh \ |
| 95 | file://0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch \ | 95 | file://0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch \ |
| 96 | file://0001-collector-Allocate-space-on-heap-for-chunks.patch \ | ||
| 96 | " | 97 | " |
| 97 | 98 | ||
| 98 | S = "${WORKDIR}/git" | 99 | S = "${WORKDIR}/git" |
