Performance: Pack performance data to SQUAD

Pack memory footprint and profiling data together to performance
metrics JSON file. Send it to current QA-Report SQUAD dashboard.

Now performance script generates the data of storage during the
build process, and then saves as JSON file in the SHARE_FOLDER.
After LAVA testing artifacts, the script collects the profiling
data from the target log and sends all performance data to SQUAD.

Signed-off-by: Jianliang Shen <jianliang.shen@arm.com>
Change-Id: I29ffef8fa53def896df67d1e2b1818caf435506b
diff --git a/jenkins/build-config.jpl b/jenkins/build-config.jpl
index d714897..802f0e8 100644
--- a/jenkins/build-config.jpl
+++ b/jenkins/build-config.jpl
@@ -40,18 +40,11 @@
         if (upstreamProject == "tf-m-build-and-test") {
           archiveArtifacts 'trusted-firmware-m/build/generated/**'
         }
-        if (env.SQUAD_CONFIGURATIONS == "enabled"){
+        if (upstreamProject == "tf-m-nightly-performance"){
           //Creating a folder to store memory footprint artifacts and launching the memory footprint script.
-          sh "mkdir tf-m-ci-scripts/Memory_footprint/"
-          withCredentials([string(credentialsId: 'QA_REPORTS_TOKEN', variable: 'TOKEN')]) {
-            output = sh(script: """python3 tf-m-ci-scripts/memory_footprint.py ${TOKEN}""", returnStdout: true).trim()
-          }
-          if (fileExists('tf-m-ci-scripts/Memory_footprint/filesize.json')) {
-            println("--- output from memory_footprint.py ---")
-            println(output)
-            println("--- end of output from memory_footprint.py ---")
-            archiveArtifacts 'tf-m-ci-scripts/Memory_footprint/filesize.json'
-          }
+          sh "mkdir -p ${SHARE_FOLDER}/Memory_footprint/"
+          output = sh(script: """python3 tf-m-ci-scripts/performance.py --generate-memory""", returnStdout: true).trim()
+          println(output)
         }
       }
     } catch (Exception e) {