ftrace: Add support for syscall function tracer

This patch adds support for syscall tracing in TEE core. It complements
existing ftrace support for user TAs via adding trace for syscalls that
are invoked by user TAs into the TEE core.

And after this patch ftrace will cover both TA and TEE core code. So lets
rename config option from CFG_TA_FTRACE_SUPPORT to CFG_FTRACE_SUPPORT.

It is optional to enable syscall trace via CFG_SYSCALL_FTRACE=y config
option in addition to CFG_FTRACE_SUPPORT=y config option.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Jerome Forissier <jerome@forissier.org>
diff --git a/scripts/arm32_sysreg.py b/scripts/arm32_sysreg.py
index bcdd942..4b6f9cf 100755
--- a/scripts/arm32_sysreg.py
+++ b/scripts/arm32_sysreg.py
@@ -125,7 +125,7 @@
     print('')
     if len(descr):
         print('/* ' + descr + ' */')
-    print('static inline void write_' + reg_name.lower() + '(void)')
+    print('static inline __noprof void write_' + reg_name.lower() + '(void)')
     print('{')
     print('\t/* Register ignored */')
     print('\tasm volatile ("mcr p15, ' + opc1 + ', r0, ' + crn + ', ' +
diff --git a/scripts/symbolize.py b/scripts/symbolize.py
index 5928932..631ae6e 100755
--- a/scripts/symbolize.py
+++ b/scripts/symbolize.py
@@ -177,7 +177,11 @@
                     elf_idx = r[2]
                     if elf_idx is not None:
                         return self._elfs[int(elf_idx)][1]
-            return None
+            # In case address is not found in TA ELF file, fallback to tee.elf
+            # especially to symbolize mixed (user-space and kernel) addresses
+            # which is true when syscall ftrace is enabled along with TA
+            # ftrace.
+            return '0x0'
         else:
             # tee.elf
             return '0x0'