cgroups: fix attributes reporting for controller with only one attribute

The current code used to read the attributes values for a controller uses
a "grep '' CONTROLLER.*" under the assumption that the output is a list of
   file:value
However, if there is a single controller attribute, grep does not report
the file name in output thus returning an empty list at the python side.

This patch fix that issue by also switching to the usage of a shutil
implementation of the attributes parsing code.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
diff --git a/devlib/bin/scripts/shutils.in b/devlib/bin/scripts/shutils.in
index 9200b70..bc47719 100755
--- a/devlib/bin/scripts/shutils.in
+++ b/devlib/bin/scripts/shutils.in
@@ -55,6 +55,20 @@
     done
 }
 
+
+################################################################################
+# CGroups Utility Functions
+################################################################################
+
+cgroups_get_attributes() {
+	[[ $# -eq 2 ]] || exit -1
+	CGROUP="$1"
+	CONTROLLER="$2"
+	$GREP '' $CGROUP/* | \
+		$GREP "$CONTROLLER\." | \
+		$SED -e "s|$CONTROLLER\.||" -e "s|$CGROUP/||"
+}
+
 ################################################################################
 # Main Function Dispatcher
 ################################################################################
@@ -75,6 +89,9 @@
 cpufreq_trace_all_frequencies)
     cpufreq_trace_all_frequencies $*
     ;;
+cgroups_get_attributes)
+	cgroups_get_attributes $*
+	;;
 ftrace_get_function_stats)
     ftrace_get_function_stats
     ;;