)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1001964,"name":"Erhan Kurubas","display_name":"Erhan Kurubas","email":"erhan.kurubas@espressif.com","username":"erhankur"},"change_message_id":"e198828c2316c909b2305ad7b0d121f1389f2b6f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"08d3f1be_be356a5c","updated":"2025-02-02 13:42:48.000000000","message":"Thanks..","commit_id":"6145dde8f42905f309a3e9c964855921d804e4bd"},{"author":{"_account_id":1002273,"name":"Richard Allen","email":"rsaxvc@gmail.com","username":"rsaxvc","status":"@BryghtLabs, @rsaxvc.net"},"change_message_id":"8f0349f3db9f79a0cfb52a57e0580bf96515d7ed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"ec3b5db9_e5c193ea","updated":"2025-02-07 03:59:53.000000000","message":"Valgrind reports no memory errors, and no additional memory leaks.","commit_id":"c5fd20a798862cd44b27b16a45f3cb91baac087f"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"39b694087afb72c67a36ff2418a65fcd71bc135e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"3c1779fe_ee5b98cb","updated":"2026-05-09 19:28:38.000000000","message":"Thanks for this series.\nI see one minor issue to fix, before merging this patch.","commit_id":"cd22a7da1ed53ba6e180b02549608ae2e5838cd5"},{"author":{"_account_id":1002273,"name":"Richard Allen","email":"rsaxvc@gmail.com","username":"rsaxvc","status":"@BryghtLabs, @rsaxvc.net"},"change_message_id":"07a5bcf678b67798a9f39ae8008968a2321ca1df","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"66236157_4982f504","updated":"2026-05-13 14:34:47.000000000","message":"Double checked on ESP32-S3, working great.","commit_id":"9663a880079e1f4c90b0b9cfbf133efd15f314b0"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"ab90210ce899327531a22be764b9d1e3934360d0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"06aad6e1_afb3e3b3","updated":"2026-05-11 07:31:30.000000000","message":"Thanks","commit_id":"9663a880079e1f4c90b0b9cfbf133efd15f314b0"}],"src/target/target.c":[{"author":{"_account_id":1001964,"name":"Erhan Kurubas","display_name":"Erhan Kurubas","email":"erhan.kurubas@espressif.com","username":"erhankur"},"change_message_id":"0c724e704fa977e88c976077534578471d5f900c","unresolved":true,"context_lines":[{"line_number":4313,"context_line":""},{"line_number":4314,"context_line":"static int compare_pc(const void *p1, const void *p2)"},{"line_number":4315,"context_line":"{"},{"line_number":4316,"context_line":"\tuint32_t lhs, rhs;"},{"line_number":4317,"context_line":"\tmemcpy(\u0026lhs, p1, sizeof(lhs));"},{"line_number":4318,"context_line":"\tmemcpy(\u0026rhs, p2, sizeof(rhs));"},{"line_number":4319,"context_line":"\tif (lhs \u003c rhs)"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"5914c60d_5fcc6049","line":4316,"updated":"2025-02-01 13:03:21.000000000","message":"How about without using mempcpy?\n\n    uint32_t lhs \u003d *(const uint32_t *)p1;\n    uint32_t rhs \u003d *(const uint32_t *)p2;\n    return (lhs \u003e rhs) - (lhs \u003c rhs);","commit_id":"ae51b062c78d107d3e8d12bb29ed8c607c227283"},{"author":{"_account_id":1002273,"name":"Richard Allen","email":"rsaxvc@gmail.com","username":"rsaxvc","status":"@BryghtLabs, @rsaxvc.net"},"change_message_id":"3b95a695333f238e02934962840f44d24b86ef3b","unresolved":false,"context_lines":[{"line_number":4313,"context_line":""},{"line_number":4314,"context_line":"static int compare_pc(const void *p1, const void *p2)"},{"line_number":4315,"context_line":"{"},{"line_number":4316,"context_line":"\tuint32_t lhs, rhs;"},{"line_number":4317,"context_line":"\tmemcpy(\u0026lhs, p1, sizeof(lhs));"},{"line_number":4318,"context_line":"\tmemcpy(\u0026rhs, p2, sizeof(rhs));"},{"line_number":4319,"context_line":"\tif (lhs \u003c rhs)"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"fc9a59f4_7edd6bed","line":4316,"in_reply_to":"409df0cb_4bbce632","updated":"2025-02-02 05:42:51.000000000","message":"Done","commit_id":"ae51b062c78d107d3e8d12bb29ed8c607c227283"},{"author":{"_account_id":1002273,"name":"Richard Allen","email":"rsaxvc@gmail.com","username":"rsaxvc","status":"@BryghtLabs, @rsaxvc.net"},"change_message_id":"6bc856b0be57f022e2fbfc23080298ac8301ba7c","unresolved":true,"context_lines":[{"line_number":4313,"context_line":""},{"line_number":4314,"context_line":"static int compare_pc(const void *p1, const void *p2)"},{"line_number":4315,"context_line":"{"},{"line_number":4316,"context_line":"\tuint32_t lhs, rhs;"},{"line_number":4317,"context_line":"\tmemcpy(\u0026lhs, p1, sizeof(lhs));"},{"line_number":4318,"context_line":"\tmemcpy(\u0026rhs, p2, sizeof(rhs));"},{"line_number":4319,"context_line":"\tif (lhs \u003c rhs)"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"409df0cb_4bbce632","line":4316,"in_reply_to":"5914c60d_5fcc6049","updated":"2025-02-02 05:22:01.000000000","message":"Good idea - these will always be properly aligned.","commit_id":"ae51b062c78d107d3e8d12bb29ed8c607c227283"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"39b694087afb72c67a36ff2418a65fcd71bc135e","unresolved":true,"context_lines":[{"line_number":4291,"context_line":"\tfclose(f);"},{"line_number":4292,"context_line":"}"},{"line_number":4293,"context_line":""},{"line_number":4294,"context_line":"static int compare_pc32(const void *p1, const void *p2)"},{"line_number":4295,"context_line":"{"},{"line_number":4296,"context_line":"\tuint32_t lhs \u003d *(const uint32_t *)p1;"},{"line_number":4297,"context_line":"\tuint32_t rhs \u003d *(const uint32_t *)p2;"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"21ba1404_3fac74d8","line":4294,"updated":"2026-05-09 19:28:38.000000000","message":"Please add a comment before this \u0027unusual\u0027 function:\n`// comparison function for qsort(). Returns -1, 0 or +1`","commit_id":"cd22a7da1ed53ba6e180b02549608ae2e5838cd5"},{"author":{"_account_id":1002273,"name":"Richard Allen","email":"rsaxvc@gmail.com","username":"rsaxvc","status":"@BryghtLabs, @rsaxvc.net"},"change_message_id":"ff3c0e6396956b17614c57fcc99bc00ad9f0c295","unresolved":false,"context_lines":[{"line_number":4291,"context_line":"\tfclose(f);"},{"line_number":4292,"context_line":"}"},{"line_number":4293,"context_line":""},{"line_number":4294,"context_line":"static int compare_pc32(const void *p1, const void *p2)"},{"line_number":4295,"context_line":"{"},{"line_number":4296,"context_line":"\tuint32_t lhs \u003d *(const uint32_t *)p1;"},{"line_number":4297,"context_line":"\tuint32_t rhs \u003d *(const uint32_t *)p2;"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"62b0048d_11399bb0","line":4294,"in_reply_to":"21ba1404_3fac74d8","updated":"2026-05-11 04:36:55.000000000","message":"Done","commit_id":"cd22a7da1ed53ba6e180b02549608ae2e5838cd5"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"39b694087afb72c67a36ff2418a65fcd71bc135e","unresolved":true,"context_lines":[{"line_number":4387,"context_line":"\t\t\tif (sample \u003e\u003d start_address \u0026\u0026 sample \u003c end_address)"},{"line_number":4388,"context_line":"\t\t\t\tsamples[num_filtered_samples++] \u003d sample;"},{"line_number":4389,"context_line":"\t\t}"},{"line_number":4390,"context_line":"\t\tduration_ms \u003d lround(duration_ms * num_filtered_samples / num_of_samples);"},{"line_number":4391,"context_line":"\t\tif (duration_ms \u003c 1)"},{"line_number":4392,"context_line":"\t\t\tduration_ms \u003d 0;"},{"line_number":4393,"context_line":"\t\tnum_of_samples \u003d num_filtered_samples;"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"3625aaaf_8776a4d4","line":4390,"updated":"2026-05-09 19:28:38.000000000","message":"If I see ahead:\n4349: `uint32_t duration_ms \u003d timeval_ms() - timestart_ms;`\n3284: `uint32_t num_filtered_samples \u003d 0;`\n4312: `uint32_t num_of_samples;`\n\nAll the variables in the computation are `uint32_t`, so the C language will mandate the computation to be strictly done as unsigned 32 bits.\n\nFirst this computation has some issue, as the multiplication could exceed 32 bits.\nSince in line 4349 the operands are 75 bits, I would prefer having\n`uint64_t duration_ms \u003d timeval_ms() - timestart_ms;`\nto force the multiplication result in 64 bits.\n\nSecond, the division is between unsigned integers, so the result is integer through truncation.\nWhy there is the call to `lround()` ???\n`man lround` reports the prototype:\n`long lround(double x);`\nSo this operation takes an unsigned integer (the result of multiplication and division), converts it to double to call `lround`, and the result is the same unsigned integer we started with. It\u0027s just an incorrect, useless and expensive operation.\n\nIf you really want to compute the nearest integer to the division value (without truncation) you should better use integer arithmetic with\n`duration_ms \u003d (duration_ms * num_filtered_samples + num_of_samples / 2) / num_of_samples;`\nand of course, drop the now unneeded line\n`#include \u003cmath.h\u003e`","commit_id":"cd22a7da1ed53ba6e180b02549608ae2e5838cd5"},{"author":{"_account_id":1002273,"name":"Richard Allen","email":"rsaxvc@gmail.com","username":"rsaxvc","status":"@BryghtLabs, @rsaxvc.net"},"change_message_id":"ff3c0e6396956b17614c57fcc99bc00ad9f0c295","unresolved":false,"context_lines":[{"line_number":4387,"context_line":"\t\t\tif (sample \u003e\u003d start_address \u0026\u0026 sample \u003c end_address)"},{"line_number":4388,"context_line":"\t\t\t\tsamples[num_filtered_samples++] \u003d sample;"},{"line_number":4389,"context_line":"\t\t}"},{"line_number":4390,"context_line":"\t\tduration_ms \u003d lround(duration_ms * num_filtered_samples / num_of_samples);"},{"line_number":4391,"context_line":"\t\tif (duration_ms \u003c 1)"},{"line_number":4392,"context_line":"\t\t\tduration_ms \u003d 0;"},{"line_number":4393,"context_line":"\t\tnum_of_samples \u003d num_filtered_samples;"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"5001f951_33dee0ab","line":4390,"in_reply_to":"3625aaaf_8776a4d4","updated":"2026-05-11 04:36:55.000000000","message":"Done","commit_id":"cd22a7da1ed53ba6e180b02549608ae2e5838cd5"}]}
