A method of analyzing program execution in a robotic device, the method comprising: by an operating system comprising processor and that is communicatively connected to a plurality of sensors and a plurality of components of a robotic device: receiving sensor data from the plurality of sensors of the robotic device; for each sensor: generating a data log comprising an identifier of a first checkpoint associated with that sensor and a first timestamp, performing an execution flow comprising one or more processes (211A - 211C) on the sensor data from that sensor, wherein the execution flow comprises a sequence of functions that are to be performed in a particular order, wherein a function refers to one or more operational instructions that cause the operating system to perform one or more actions, and updating the data log to include an identifier and time stamp for one or more additional checkpoints (B, C, D) during the execution flow, fusing results from each execution flow to yield fused data; using the fused data as an input for a decision process; causing a component of the robotic device to take an action in response to an output of the decision process, wherein the action comprises causing the robotic device to operate in a safe mode; recording the action, an action timestamp and the data logs for each sensor in a memory; determining whether, for any sensor, a difference between the action timestamp and the first timestamp for that sensor exceeds a threshold; and for any sensor whose difference exceeds the threshold, using the data log for that sensor to trace the execution flow for that sensor and identify a cause of latency in that execution flow. by an operating system comprising processor and that is communicatively connected to a plurality of sensors and a plurality of components of a robotic device: receiving sensor data from the plurality of sensors of the robotic device; for each sensor: generating a data log comprising an identifier of a first checkpoint associated with that sensor and a first timestamp, performing an execution flow comprising one or more processes (211A - 211C) on the sensor data from that sensor, wherein the execution flow comprises a sequence of functions that are to be performed in a particular order, wherein a function refers to one or more operational instructions that cause the operating system to perform one or more actions, and updating the data log to include an identifier and time stamp for one or more additional checkpoints (B, C, D) during the execution flow, fusing results from each execution flow to yield fused data; using the fused data as an input for a decision process; causing a component of the robotic device to take an action in response to an output of the decision process, wherein the action comprises causing the robotic device to operate in a safe mode; recording the action, an action timestamp and the data logs for each sensor in a memory; receiving sensor data from the plurality of sensors of the robotic device; for each sensor: generating a data log comprising an identifier of a first checkpoint associated with that sensor and a first timestamp, performing an execution flow comprising one or more processes (211A - 211C) on the sensor data from that sensor, wherein the execution flow comprises a sequence of functions that are to be performed in a particular order, wherein a function refers to one or more operational instructions that cause the operating system to perform one or more actions, and updating the data log to include an identifier and time stamp for one or more additional checkpoints (B, C, D) during the execution flow, fusing results from each execution flow to yield fused data; generating a data log comprising an identifier of a first checkpoint associated with that sensor and a first timestamp, performing an execution flow comprising one or more processes (211A - 211C) on the sensor data from that sensor, wherein the execution flow comprises a sequence of functions that are to be performed in a particular order, wherein a function refers to one or more operational instructions that cause the operating system to perform one or more actions, and updating the data log to include an identifier and time stamp for one or more additional checkpoints (B, C, D) during the execution flow, fusing results from each execution flow to yield fused data; using the fused data as an input for a decision process; causing a component of the robotic device to take an action in response to an output of the decision process, wherein the action comprises causing the robotic device to operate in a safe mode; recording the action, an action timestamp and the data logs for each sensor in a memory; determining whether, for any sensor, a difference between the action timestamp and the first timestamp for that sensor exceeds a threshold; and for any sensor whose difference exceeds the threshold, using the data log for that sensor to trace the execution flow for that sensor and identify a cause of latency in that execution flow.