summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-11-10 23:21:15 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-11-10 23:21:15 +0100
commitc2e0d600ed76f6767d59715d93cf862808552ea2 (patch)
tree8e6e7b433a847b60530512868f28917bb7927131 /src/core
parent95056b27a05c527f4724b6c52abb2a7a69a3a5d0 (diff)
analyze: plot the time spent setting up security modules
Diffstat (limited to 'src/core')
-rw-r--r--src/core/dbus-manager.c8
-rw-r--r--src/core/main.c6
-rw-r--r--src/core/manager.h2
3 files changed, 16 insertions, 0 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index b47fc85101..747bcfcb91 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -271,6 +271,10 @@
" <property name=\"UserspaceTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"FinishTimestamp\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"FinishTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
+ " <property name=\"SecurityStartTimestamp\" type=\"t\" access=\"read\"/>\n" \
+ " <property name=\"SecurityStartTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
+ " <property name=\"SecurityFinishTimestamp\" type=\"t\" access=\"read\"/>\n" \
+ " <property name=\"SecurityFinishTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"GeneratorsStartTimestamp\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"GeneratorsStartTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"GeneratorsFinishTimestamp\" type=\"t\" access=\"read\"/>\n" \
@@ -583,6 +587,10 @@ static const BusProperty bus_manager_properties[] = {
{ "UserspaceTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, userspace_timestamp.monotonic) },
{ "FinishTimestamp", bus_property_append_uint64, "t", offsetof(Manager, finish_timestamp.realtime) },
{ "FinishTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, finish_timestamp.monotonic) },
+ { "SecurityStartTimestamp", bus_property_append_uint64, "t", offsetof(Manager, security_start_timestamp.realtime) },
+ { "SecurityStartTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, security_start_timestamp.monotonic) },
+ { "SecurityFinishTimestamp", bus_property_append_uint64, "t", offsetof(Manager, security_finish_timestamp.realtime) },
+ { "SecurityFinishTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, security_finish_timestamp.monotonic) },
{ "GeneratorsStartTimestamp", bus_property_append_uint64, "t", offsetof(Manager, generators_start_timestamp.realtime) },
{ "GeneratorsStartTimestampMonotonic", bus_property_append_uint64, "t", offsetof(Manager, generators_start_timestamp.monotonic) },
{ "GeneratorsFinishTimestamp", bus_property_append_uint64, "t", offsetof(Manager, generators_finish_timestamp.realtime) },
diff --git a/src/core/main.c b/src/core/main.c
index ede1a121c6..c89c12343e 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1201,6 +1201,8 @@ int main(int argc, char *argv[]) {
dual_timestamp initrd_timestamp = { 0ULL, 0ULL };
dual_timestamp userspace_timestamp = { 0ULL, 0ULL };
dual_timestamp kernel_timestamp = { 0ULL, 0ULL };
+ dual_timestamp security_start_timestamp = { 0ULL, 0ULL };
+ dual_timestamp security_finish_timestamp = { 0ULL, 0ULL };
static char systemd[] = "systemd";
bool skip_setup = false;
int j;
@@ -1265,12 +1267,14 @@ int main(int argc, char *argv[]) {
if (!skip_setup) {
mount_setup_early();
+ dual_timestamp_get(&security_start_timestamp);
if (selinux_setup(&loaded_policy) < 0)
goto finish;
if (ima_setup() < 0)
goto finish;
if (smack_setup() < 0)
goto finish;
+ dual_timestamp_get(&security_finish_timestamp);
}
if (label_init(NULL) < 0)
@@ -1541,6 +1545,8 @@ int main(int argc, char *argv[]) {
m->userspace_timestamp = userspace_timestamp;
m->kernel_timestamp = kernel_timestamp;
m->initrd_timestamp = initrd_timestamp;
+ m->security_start_timestamp = security_start_timestamp;
+ m->security_finish_timestamp = security_finish_timestamp;
manager_set_default_rlimits(m, arg_default_rlimit);
diff --git a/src/core/manager.h b/src/core/manager.h
index 150525ee13..b043970340 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -153,6 +153,8 @@ struct Manager {
dual_timestamp initrd_timestamp;
dual_timestamp userspace_timestamp;
dual_timestamp finish_timestamp;
+ dual_timestamp security_start_timestamp;
+ dual_timestamp security_finish_timestamp;
dual_timestamp generators_start_timestamp;
dual_timestamp generators_finish_timestamp;
dual_timestamp unitsload_start_timestamp;