esp-idf/components
Stephen Casner bc2879a956 heap: Add task tracking option for heap usage monitoring
Add back a feature that was available in the old heap implementation
in release/v2.1 and earlier: keep track of which task allocates each
block from the heap. The task handle is conditionally added as
another word in the heap poisoning header under this configuration
option CONFIG_HEAP_TASK_TRACKING.

To allow custom monitoring and debugging code to be added, add helper
functions in multi_heap.c and multi_heap_poisoning.c to provide access
to information in the block headers.

Add esp_heap_debug_dump_totals() to monitor heap usage

esp_heap_debug_dump_totals() dumps into a user-provided data structure
a summary of the amound of heap memory in region type that is used by
each task.  Optionally it will also dump into another data structure
the metadata about each allocated block for a given list of tasks or
for all tasks (limited by available space).

Address change requests on PR #1498

This set of changes fixes the files in e3b702c to just add the
CONFIG_HEAP_TASK_TRACKING option without adding the new function
heap_caps_get_per_task_info() in case that is the only portion of the
PR that will be accepted.  Part of the change is to remove the new .c
and .h files containing that function and to remove the line to
compile it from components/heap/component.mk since it should not have
been included in e3b702c.  One or more additional commits to add the
new function will follow.

The other changes here:
- uint32_t get_all_caps() moves to heap_private.h
- replace "void* foo" with "void *foo"
- add braces around single-line "if" blocks
- replace tab characters with spaces

Address change requests on PR #1498, part 2

This set of changes fixes the files in cdf32aa to add the new function
heap_caps_get_per_task_info() with its new name and to add the line to
compile it in components/heap/component.mk.  This does not address all
the suggested changes because there are some needing further
discussion.

This commit does not include the suggested change to move the
declaration of the new function into esp_heap_caps.h because the new
function references TaskHandle_t so esp_heap_caps.h would have to
include freertos/FreeRTOS.h and freertos/task.h, but FreeRTOS.h
includes esp_heap_caps.h through two other header files which results
in compilation errors because not all of FreeRTOS.h has been read yet.

Change heap_caps_get_per_task_info() to take struct of params

In addition to moving the large number of function parameters into a
struct as the single parameter, the following changes were made:

- Clear out the totals for any prepopulated tasks so the app code
  doesn't have to do it.

- Rather than partitioning the per-task totals into a predetermined
  set of heap capabilities, take a list of <caps,mask> pairs to
  compare the caps to the heap capabilities as masked.  This lets the
  caller configure the desired partitioning, or none.

- Allow the totals array pointer or the blocks array pointer to be
  NULL to indicate not to collect that part of the information.

- In addition to returning the total space allocated by each task,
  return the number of blocks allocated by each task.

- Don't need to return the heap capabilities as part of the details
  for each block since the heap region (and therefore its
  capabilities) can be determined from the block address.

- Renamed heap_task_info.h to esp_heap_task_info.h to fit the naming
  convention, and renamed the structs for totals and block details to
  better fit the revised function name.

- Provide full Doxygen commenting for the function and parameter
  structs.

Add copyright header to new files

Merges https://github.com/espressif/esp-idf/pull/1498
2018-02-20 10:32:06 +11:00
..
app_trace sysview: fix compilation in 1 core mode, refactor timer choices 2018-01-17 12:23:28 +08:00
app_update ota_ops: Fix get_selected_boot_partition() in case there is no factory partition 2017-09-04 17:37:28 +10:00
aws_iot aws iot: Expose Thing Shadow settings in menuconfig 2018-02-05 14:38:23 +08:00
bootloader build system: Fix undefined variables 2017-12-28 19:21:34 +08:00
bootloader_support Protect partition table by MD5 checksum 2018-02-05 11:36:03 +01:00
bt Fix function name typo. Closes https://github.com/espressif/esp-idf/issue/1572 2018-02-13 15:05:56 +01:00
coap Ensure that C++ and C compilers get the same preprocessor setup 2017-10-26 13:04:41 +02:00
console console: Add C++ guards to header 2018-01-29 09:22:04 +08:00
cxx unit tests: make static init guard test single core compatible 2018-01-23 07:56:13 +00:00
driver Merge branch 'test/adc2_with_wifi_reopen' into 'master' 2018-02-11 22:32:18 +08:00
esp32 esp32: increase default event task stack size by 256 bytes 2018-02-11 13:06:01 +08:00
esp_adc_cal feature(I2S-ADC): add ADC mode for I2S. 2017-09-14 13:24:08 +08:00
espcoredump bugfix: fixed path to esptool when there is no compiled python module for it 2017-03-21 13:30:38 +03:00
esptool_py esptool: Update to v2.2.1 2018-01-24 17:45:49 +11:00
ethernet Set direction of SMI pins MDC and MDIO correctly. 2018-02-11 16:11:14 +08:00
expat
fatfs fatfs: check allocated workbuf pointer 2018-02-11 13:03:36 +08:00
freertos Merge branch 'feature/tls_support' into 'master' 2018-02-09 12:34:20 +08:00
heap heap: Add task tracking option for heap usage monitoring 2018-02-20 10:32:06 +11:00
idf_test Merge branch 'test/spi_performance' into 'master' 2018-02-08 22:59:40 +08:00
jsmn Add jsmn JSON parser component 2017-03-07 10:18:47 +11:00
json Update cJSON to v1.7.1 2018-02-05 14:15:26 +08:00
libsodium unit tests: fix warnings, build with -Werror 2017-10-19 21:35:23 +08:00
log component/bt: Fix BLE printf missing problem 2018-02-06 14:35:39 +08:00
lwip Change ESP_ERR_PING_BASE because of collision with ESP_ERR_TCPIP_ADAPTER_BASE 2018-02-06 12:34:12 +01:00
mbedtls Add #include guards and __cplusplus guards to esp_debug.h 2017-12-07 10:25:57 +11:00
mdns mdns: Fix case where service is NULL and that will cause exception 2018-01-22 13:56:53 +01:00
micro-ecc
newlib time: rename time source option from FRC to "high-resolution timer" 2017-12-11 12:37:08 +08:00
nghttp Ensure that C++ and C compilers get the same preprocessor setup 2017-10-26 13:04:41 +02:00
nvs_flash Fix compilation errors when using gcc-7.2.0 for the crosstool-ng toolchain 2017-12-04 10:18:40 +11:00
openssl openssl: add feature check for MBEDTLS_SSL_ALPN 2017-12-08 13:00:11 +08:00
partition_table Protect partition table by MD5 checksum 2018-02-05 11:36:03 +01:00
pthread Removed logging from pthread conditional variable which completely drowned out any other logging and also had negative effects on the RMT due to sharing the same log system. Related to #1345 / TW#16842 2017-12-28 15:21:00 +01:00
sdmmc test(sdmmc_host): add new test to probe over SD (1-bit). 2018-02-07 12:05:05 +08:00
soc Merge branch 'bugfix/fix_i2s_adc_mode' into 'master' 2018-02-11 12:58:58 +08:00
spi_flash bug fix of assert happen in PSRAM 2018-01-09 20:01:06 +08:00
spiffs spiffs: fix esp_spiffs_format not working if partition is not mounted 2018-01-31 14:29:13 +08:00
tcpip_adapter tcpip_adapter: make log output at debug level less noisy 2018-02-11 13:06:01 +08:00
ulp soc,ulp: add register definitions of RTC_I2C peripheral 2018-01-08 21:28:14 +08:00
vfs add missing ioctl declaration 2017-10-23 19:47:33 +08:00
wear_levelling unit test: adapt tests to single core configuration 2017-10-19 21:35:21 +08:00
wpa_supplicant Add the fast crypto function in supplicant 2017-08-09 21:36:13 +08:00
xtensa-debug-module esp32: Apptrace API enhancement 2017-07-24 19:57:44 +03:00