)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1002273,"name":"Richard Allen","email":"rsaxvc@gmail.com","username":"rsaxvc","status":"@BryghtLabs, @rsaxvc.net"},"change_message_id":"17b49a915f0c35cc3d3cbe4bbb0e3cfbee76e6b1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f88a0f07_b78b5066","updated":"2024-08-09 03:54:59.000000000","message":"Not yet ready for merge. Only tested on ESP32-S3 so far.\n\nIan, can you say if this is the right way to sample the program counter non-intrusively, and is this a reasonable way to detect if the DEBUGPC is present on a particular chip?","commit_id":"fd363a0b2fa7759e2d390052bae40f46cc062b55"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"488885224790b1b3608f1dee65456e2d94e05cbd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"cb0a450d_a46bf7f9","updated":"2024-08-15 14:06:12.000000000","message":"Hi, Richard,\n\nSorry for the slow reply--it took some time to dig up information on DebugPC.\n\nThis register is undocumented because it was not intended to be used externally. It may or may not exist on different versions of Xtensa, or even Xtensa cores with different configuration options, and there is no deterministic way to tell if it is present other than reading it and looking for a reasonable value given your memory map. But that said, if it is present, then for the most part it should be faithful to the real PC. I\u0027ve confirmed there are no side effects from reading it.\n\nThanks,\n--ian","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"80f4506cdee94acb8bf5a664b660f1c85ac7dc19","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"00ec5e54_b4d26b35","updated":"2024-08-15 18:17:29.000000000","message":"Richard--since this is not an officially-supported Xtensa feature, I would like to request that you relocate DebugPC and xtensa_profiling() support into src/target/espressif/, along with a name change to something like esp32_profiling().  \n\nCadence are not planning to support this on generic Xtensa cores, so it should not be referenced anywhere in src/target/xtensa/.  Thanks.","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"},{"author":{"_account_id":1002273,"name":"Richard Allen","email":"rsaxvc@gmail.com","username":"rsaxvc","status":"@BryghtLabs, @rsaxvc.net"},"change_message_id":"b914dd91b2b80ecc0b0ec3e451f64ce26dd1a5d4","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"6706c4f9_50dde623","in_reply_to":"00ec5e54_b4d26b35","updated":"2024-08-16 00:51:59.000000000","message":"Got it, I can do that.","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"},{"author":{"_account_id":1002306,"name":"Richard Allen","display_name":"Richard Allen","email":"rsaxvc@rsaxvc.net"},"change_message_id":"a64a42b215cb04eb40a2122fffc5625d03a5d38b","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"acf3e872_357dd71e","in_reply_to":"6706c4f9_50dde623","updated":"2024-08-17 20:22:54.000000000","message":"I\u0027ve got xtensa_profiling() moved over to esp_xtensa_profiling(). I\u0027m not sure that it makes sense to duplicate the code for xtensa_queue_dbg_reg_read(), xtensa_dm_queue_reg_read(), and xtensa_dm_reg_offsets[] per-target with DEBUGPC just to keep references to this TRAX register out of the xtensa folder, so for now I\u0027ve added a comment to XDMREG_DEBUGPC noting your concerns. I hope that\u0027s alright.","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"86dcb87eca7176413e1c92cfc0655799e4d8dfce","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"4df4a1e5_5bd1f94e","in_reply_to":"acf3e872_357dd71e","updated":"2024-08-19 23:46:04.000000000","message":"That sounds fair.  Don\u0027t want to duplicate any code unnecessarily.","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"},{"author":{"_account_id":1002278,"name":"bryghtlabs-richard","display_name":"Richard Allen","username":"bryghtlabs-richard","status":"Firmware at BryghtLabs. Also rsaxvc at home."},"change_message_id":"72700ce4d71e847fc46d45d733fc36ebb8f8b519","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"ae8c0469_62b82135","updated":"2024-09-12 17:46:31.000000000","message":"Is there anything I can do to help, or any thoughts from Espressif? I\u0027ve limited it to ESP32-S3 until it could be tested on ESP32 or ESP32-S2.\n\nIf this will take a bit to review, I\u0027m ok with Yurii\u0027s changes going in first and will update this afterward.","commit_id":"8fbc87cf0e33f1dbc7f1b814b4491666ded85f3f"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d03304284745a5204fdcb34ccb6334cb0a576e3a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"ff60f95e_dc97c12d","updated":"2024-09-01 13:24:32.000000000","message":"Looks ok.\nIt conflicts with the ongoing patch from Yurii for 64bit PC profiling\nhttps://review.openocd.org/c/openocd/+/8405\nI think we can merge this first and report the modifications in 8405","commit_id":"8fbc87cf0e33f1dbc7f1b814b4491666ded85f3f"},{"author":{"_account_id":1002296,"name":"Yurii Shutkin","email":"yurii.shutkin@gmail.com","username":"yshutkin"},"change_message_id":"66f7bff94b358560a433b1424424f27eb1420cf7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"101e8d60_0328d809","updated":"2024-09-03 07:56:23.000000000","message":"Okay, I\u0027ll update my patch after this one is merged.","commit_id":"8fbc87cf0e33f1dbc7f1b814b4491666ded85f3f"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"86dcb87eca7176413e1c92cfc0655799e4d8dfce","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"219b2892_f7db3399","updated":"2024-08-19 23:46:04.000000000","message":"Thanks for moving the function to esp_xtensa_profiling().  Looks reasonable to me... +1.","commit_id":"8fbc87cf0e33f1dbc7f1b814b4491666ded85f3f"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a04662e2527ef0bd570b5c3cc85d17d32a6f1d16","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"93a211ff_09c1fb55","in_reply_to":"101e8d60_0328d809","updated":"2024-09-15 09:13:01.000000000","message":"Thanks!","commit_id":"8fbc87cf0e33f1dbc7f1b814b4491666ded85f3f"},{"author":{"_account_id":1001964,"name":"Erhan Kurubas","display_name":"Erhan Kurubas","email":"erhan.kurubas@espressif.com","username":"erhankur"},"change_message_id":"e2a82f93f9b81f32051783d288994d329858e674","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"0f5a0381_2e8a63ba","in_reply_to":"ae8c0469_62b82135","updated":"2024-09-13 05:41:05.000000000","message":"Hi Richard, thank you for your cooperation. The changes LGTM. We are fine with the ESP32-S3 as the first chip. I believe this will be merged soon.","commit_id":"8fbc87cf0e33f1dbc7f1b814b4491666ded85f3f"}],"src/target/xtensa/xtensa.c":[{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"488885224790b1b3608f1dee65456e2d94e05cbd","unresolved":true,"context_lines":[{"line_number":2654,"context_line":"\txtensa_queue_dbg_reg_read(xtensa, XDMREG_DEBUGPC, buf);"},{"line_number":2655,"context_line":"\tres \u003d xtensa_dm_queue_execute(\u0026xtensa-\u003edbg_mod);"},{"line_number":2656,"context_line":"\tif (res !\u003d ERROR_OK) {"},{"line_number":2657,"context_line":"\t\tLOG_TARGET_INFO(target, \"Failed to read DEBUGPC, fallback to stop-and-go\");"},{"line_number":2658,"context_line":"\t\treturn target_profiling_default(target, samples, max_num_samples, num_samples, seconds);"},{"line_number":2659,"context_line":"\t} else if (buf[0] \u003d\u003d 0 \u0026\u0026 buf[1] \u003d\u003d 0 \u0026\u0026 buf[2] \u003d\u003d 0 \u0026\u0026 buf[3] \u003d\u003d 0) {"},{"line_number":2660,"context_line":"\t\tLOG_TARGET_INFO(target, \"NULL DEBUGPC, fallback to stop-and-go\");"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"15ff05d9_aa49b103","line":2657,"updated":"2024-08-15 14:06:12.000000000","message":"If you haven\u0027t already, I\u0027d recommend you verify this on a system without debugPC and confirm that a failed read attempt does not hang anything or require extra logic to clear an exception.","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"},{"author":{"_account_id":1002306,"name":"Richard Allen","display_name":"Richard Allen","email":"rsaxvc@rsaxvc.net"},"change_message_id":"7cd22f36a43fbc6fb6279a335bfd250e10f5090c","unresolved":false,"context_lines":[{"line_number":2654,"context_line":"\txtensa_queue_dbg_reg_read(xtensa, XDMREG_DEBUGPC, buf);"},{"line_number":2655,"context_line":"\tres \u003d xtensa_dm_queue_execute(\u0026xtensa-\u003edbg_mod);"},{"line_number":2656,"context_line":"\tif (res !\u003d ERROR_OK) {"},{"line_number":2657,"context_line":"\t\tLOG_TARGET_INFO(target, \"Failed to read DEBUGPC, fallback to stop-and-go\");"},{"line_number":2658,"context_line":"\t\treturn target_profiling_default(target, samples, max_num_samples, num_samples, seconds);"},{"line_number":2659,"context_line":"\t} else if (buf[0] \u003d\u003d 0 \u0026\u0026 buf[1] \u003d\u003d 0 \u0026\u0026 buf[2] \u003d\u003d 0 \u0026\u0026 buf[3] \u003d\u003d 0) {"},{"line_number":2660,"context_line":"\t\tLOG_TARGET_INFO(target, \"NULL DEBUGPC, fallback to stop-and-go\");"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"4dad91ac_977df593","line":2657,"in_reply_to":"15ff05d9_aa49b103","updated":"2024-08-17 20:24:11.000000000","message":"Done - have limited scope of esp_xtensa_profiling to tested espressif parts only(esp32-s3)","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"488885224790b1b3608f1dee65456e2d94e05cbd","unresolved":true,"context_lines":[{"line_number":2666,"context_line":"\t/* Make sure the target is running */"},{"line_number":2667,"context_line":"\ttarget_poll(target);"},{"line_number":2668,"context_line":"\tif (target-\u003estate \u003d\u003d TARGET_HALTED)"},{"line_number":2669,"context_line":"\t\tretval \u003d target_resume(target, 1, 0, 0, 0);"},{"line_number":2670,"context_line":""},{"line_number":2671,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":2672,"context_line":"\t\tLOG_TARGET_ERROR(target, \"Error while resuming target\");"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"44f8c5a5_7e71f3e5","line":2669,"updated":"2024-08-15 14:06:12.000000000","message":"Is the intention to leave the target running after this function exits (whether successfully or not), or to halt it again if it was halted upon entry?","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"},{"author":{"_account_id":1002273,"name":"Richard Allen","email":"rsaxvc@gmail.com","username":"rsaxvc","status":"@BryghtLabs, @rsaxvc.net"},"change_message_id":"b914dd91b2b80ecc0b0ec3e451f64ce26dd1a5d4","unresolved":true,"context_lines":[{"line_number":2666,"context_line":"\t/* Make sure the target is running */"},{"line_number":2667,"context_line":"\ttarget_poll(target);"},{"line_number":2668,"context_line":"\tif (target-\u003estate \u003d\u003d TARGET_HALTED)"},{"line_number":2669,"context_line":"\t\tretval \u003d target_resume(target, 1, 0, 0, 0);"},{"line_number":2670,"context_line":""},{"line_number":2671,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":2672,"context_line":"\t\tLOG_TARGET_ERROR(target, \"Error while resuming target\");"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"617f58eb_8efff429","line":2669,"in_reply_to":"44f8c5a5_7e71f3e5","updated":"2024-08-16 00:51:59.000000000","message":"No intent here - Cortex-M PCSR profiler leaves it running too, and this was roughly based on that. The fallback target_profiling_default() is less deterministic.","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"},{"author":{"_account_id":1001982,"name":"Ian Thompson","email":"ianst@cadence.com","username":"ianstcdns"},"change_message_id":"86dcb87eca7176413e1c92cfc0655799e4d8dfce","unresolved":false,"context_lines":[{"line_number":2666,"context_line":"\t/* Make sure the target is running */"},{"line_number":2667,"context_line":"\ttarget_poll(target);"},{"line_number":2668,"context_line":"\tif (target-\u003estate \u003d\u003d TARGET_HALTED)"},{"line_number":2669,"context_line":"\t\tretval \u003d target_resume(target, 1, 0, 0, 0);"},{"line_number":2670,"context_line":""},{"line_number":2671,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":2672,"context_line":"\t\tLOG_TARGET_ERROR(target, \"Error while resuming target\");"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"13a15890_686e470a","line":2669,"in_reply_to":"617f58eb_8efff429","updated":"2024-08-19 23:46:04.000000000","message":"Ack","commit_id":"2f599d65c06c766e3157d8ba690e591507056afd"}]}
