| 1883 | } |
| 1884 | |
| 1885 | static const ActionDescription *GetParentMarker(ICaptureContext &ctx, uint32_t eventId) |
| 1886 | { |
| 1887 | const ActionDescription *parent = ctx.GetAction(eventId); |
| 1888 | if(!parent) |
| 1889 | { |
| 1890 | rdcarray<const ActionDescription *> actions; |
| 1891 | // Search the actions to find which action contains this eventId |
| 1892 | for(const ActionDescription &action : ctx.CurRootActions()) |
| 1893 | actions.push_back(&action); |
| 1894 | |
| 1895 | while(!parent && !actions.empty()) |
| 1896 | { |
| 1897 | const ActionDescription *action = actions.back(); |
| 1898 | for(const APIEvent &event : action->events) |
| 1899 | { |
| 1900 | if(event.eventId == eventId) |
| 1901 | { |
| 1902 | parent = action; |
| 1903 | break; |
| 1904 | } |
| 1905 | } |
| 1906 | actions.pop_back(); |
| 1907 | bool addChildren = (action->eventId < eventId); |
| 1908 | if(!addChildren) |
| 1909 | { |
| 1910 | if(!action->children.empty()) |
| 1911 | addChildren = action->children[0].eventId < eventId; |
| 1912 | } |
| 1913 | |
| 1914 | if(addChildren) |
| 1915 | { |
| 1916 | for(const ActionDescription &child : action->children) |
| 1917 | actions.push_back(&child); |
| 1918 | } |
| 1919 | } |
| 1920 | } |
| 1921 | while(parent != NULL && (parent->flags != ActionFlags::PushMarker)) |
| 1922 | parent = parent->parent; |
| 1923 | |
| 1924 | return parent; |
| 1925 | } |
| 1926 | |
| 1927 | QString GetParentMarkerName(ICaptureContext &ctx, uint32_t eventId) |
| 1928 | { |
no test coverage detected