Lines Matching refs:Query
80 analyzer->FindEvents(Query::Bool(true), &found);
143 Query event_pid = Query::EventPidIs(event.thread.process_id);
144 Query event_tid = Query::EventTidIs(event.thread.thread_id);
145 Query event_time = Query::EventTimeIs(event.timestamp);
146 Query event_duration = Query::EventDurationIs(duration);
147 Query event_phase = Query::EventPhaseIs(event.phase);
148 Query event_category = Query::EventCategoryIs(event.category);
149 Query event_name = Query::EventNameIs(event.name);
150 Query event_id = Query::EventIdIs(event.id);
151 Query event_has_arg1 = Query::EventHasNumberArg("num");
152 Query event_has_arg2 = Query::EventHasStringArg("str");
153 Query event_arg1 =
154 (Query::EventArg("num") == Query::Double(event.arg_numbers["num"]));
155 Query event_arg2 =
156 (Query::EventArg("str") == Query::String(event.arg_strings["str"]));
157 Query event_has_other = Query::EventHasOther();
158 Query other_pid = Query::OtherPidIs(other.thread.process_id);
159 Query other_tid = Query::OtherTidIs(other.thread.thread_id);
160 Query other_time = Query::OtherTimeIs(other.timestamp);
161 Query other_phase = Query::OtherPhaseIs(other.phase);
162 Query other_category = Query::OtherCategoryIs(other.category);
163 Query other_name = Query::OtherNameIs(other.name);
164 Query other_id = Query::OtherIdIs(other.id);
165 Query other_has_arg1 = Query::OtherHasNumberArg("num2");
166 Query other_has_arg2 = Query::OtherHasStringArg("str2");
167 Query other_arg1 =
168 (Query::OtherArg("num2") == Query::Double(other.arg_numbers["num2"]));
169 Query other_arg2 =
170 (Query::OtherArg("str2") == Query::String(other.arg_strings["str2"]));
235 analyzer->FindEvents(Query::EventCategory() == Query::String("cat1"), &found);
240 analyzer->FindEvents(Query::EventArg("num") == Query::Int(2), &found);
246 analyzer->FindEvents(Query::EventCategory() != Query::String("cat1"), &found);
251 analyzer->FindEvents(Query::EventArg("num") != Query::Int(2), &found);
258 analyzer->FindEvents(Query::EventArg("num") < Query::Int(2), &found);
263 analyzer->FindEvents(Query::EventArg("num") <= Query::Int(2), &found);
269 analyzer->FindEvents(Query::EventArg("num") > Query::Int(3), &found);
274 analyzer->FindEvents(Query::EventArg("num") >= Query::Int(4), &found);
279 analyzer->FindEvents(Query::EventName() != Query::String("name1") &&
280 Query::EventArg("num") < Query::Int(3), &found);
285 analyzer->FindEvents(Query::EventName() == Query::String("name1") ||
286 Query::EventArg("num") == Query::Int(3), &found);
292 analyzer->FindEvents(!(Query::EventName() == Query::String("name1") ||
293 Query::EventArg("num") == Query::Int(3)), &found);
326 analyzer->FindEvents(Query::EventArg("a") + Query::EventArg("b") ==
327 Query::Int(20), &found);
332 analyzer->FindEvents(Query::EventArg("a") - Query::EventArg("b") ==
333 Query::Int(5), &found);
338 analyzer->FindEvents(Query::EventArg("a") * Query::EventArg("b") ==
339 Query::Int(50), &found);
344 analyzer->FindEvents(Query::EventArg("a") / Query::EventArg("b") ==
345 Query::Int(2), &found);
350 analyzer->FindEvents(Query::EventArg("a") % Query::EventArg("b") ==
351 Query::Int(0), &found);
355 analyzer->FindEvents(-Query::EventArg("b") == Query::Int(-10), &found);
379 analyzer->FindEvents(Query::EventName() == Query::Pattern("name?"), &found);
384 analyzer->FindEvents(Query::EventName() == Query::Pattern("name*"), &found);
390 analyzer->FindEvents(Query::EventName() != Query::Pattern("name*"), &found);
406 TRACE_EVENT_BEGIN0("cat1", "name1"); // found by duration query
409 TRACE_EVENT_BEGIN0("cat2", "name3"); // found by duration query
415 TRACE_EVENT_END0("cat2", "name3"); // found by duration query
418 TRACE_EVENT_END0("cat1", "name1"); // found by duration query
429 Query::MatchBeginWithEnd() &&
430 Query::EventDuration() > Query::Int(duration_cutoff_us) &&
431 (Query::EventCategory() == Query::String("cat1") ||
432 Query::EventCategory() == Query::String("cat2") ||
433 Query::EventCategory() == Query::String("cat3")),
451 TRACE_EVENT0("cat1", "name1"); // found by duration query
454 TRACE_EVENT0("cat2", "name3"); // found by duration query
470 Query::EventCompleteDuration() > Query::Int(duration_cutoff_us) &&
471 (Query::EventCategory() == Query::String("cat1") ||
472 Query::EventCategory() == Query::String("cat2") ||
473 Query::EventCategory() == Query::String("cat3")),
500 analyzer->FindEvents(Query::MatchBeginWithEnd(), &found);
523 analyzer->FindEvents(Query::MatchBeginName("name1"), &found);
556 analyzer->FindEvents(Query::MatchAsyncBeginWithNext(), &found);
588 analyzer->FindEvents(Query::MatchAsyncBeginWithNext(), &found);
640 Query begin(Query::EventName() == Query::String("begin"));
641 Query end(Query::EventName() == Query::String("end"));
642 Query match(Query::EventArg("id") == Query::OtherArg("id"));
648 analyzer->FindEvents(Query::EventCategory() == Query::String("cat1") &&
649 Query::EventHasOther(), &found);
653 analyzer->FindEvents(Query::EventCategory() == Query::String("cat1") &&
654 !Query::EventHasOther(), &found);
658 analyzer->FindEvents(Query::EventCategory() == Query::String("cat6") &&
659 !Query::EventHasOther(), &found);
663 analyzer->FindEvents(Query::EventCategory() == Query::String("cat2") &&
664 Query::OtherCategory() == Query::String("cat4"), &found);
668 analyzer->FindEvents(Query::EventCategory() == Query::String("cat4") &&
669 Query::OtherCategory() == Query::String("cat2"), &found);
673 analyzer->FindEvents(Query::EventCategory() == Query::String("cat3") &&
674 Query::OtherCategory() == Query::String("cat5"), &found);
678 analyzer->FindEvents(Query::EventCategory() == Query::String("cat5") &&
679 Query::OtherCategory() == Query::String("cat3"), &found);
683 // Verify that Query literals and types are properly casted.
692 EXPECT_TRUE((Query::Double(5.0) == Query::Int(char_num)).Evaluate(dummy));
693 EXPECT_TRUE((Query::Double(-5.0) == Query::Int(short_num)).Evaluate(dummy));
694 EXPECT_TRUE((Query::Double(1.0) == Query::Uint(1u)).Evaluate(dummy));
695 EXPECT_TRUE((Query::Double(1.0) == Query::Int(1)).Evaluate(dummy));
696 EXPECT_TRUE((Query::Double(-1.0) == Query::Int(-1)).Evaluate(dummy));
697 EXPECT_TRUE((Query::Double(1.0) == Query::Double(1.0f)).Evaluate(dummy));
698 EXPECT_TRUE((Query::Bool(true) == Query::Int(1)).Evaluate(dummy));
699 EXPECT_TRUE((Query::Bool(false) == Query::Int(0)).Evaluate(dummy));
700 EXPECT_TRUE((Query::Bool(true) == Query::Double(1.0f)).Evaluate(dummy));
701 EXPECT_TRUE((Query::Bool(false) == Query::Double(0.0f)).Evaluate(dummy));
783 EXPECT_FALSE(FindFirstOf(event_ptrs, Query::Bool(true), 0, &index));
784 EXPECT_FALSE(FindFirstOf(event_ptrs, Query::Bool(true), 10, &index));
785 EXPECT_FALSE(FindLastOf(event_ptrs, Query::Bool(true), 0, &index));
786 EXPECT_FALSE(FindLastOf(event_ptrs, Query::Bool(true), 10, &index));
794 Query query_bam = Query::EventName() == Query::String(events[bam_index].name);
797 EXPECT_FALSE(FindFirstOf(event_ptrs, Query::Bool(false), 0, &index));
798 EXPECT_TRUE(FindFirstOf(event_ptrs, Query::Bool(true), 0, &index));
800 EXPECT_TRUE(FindFirstOf(event_ptrs, Query::Bool(true), 5, &index));
810 EXPECT_FALSE(FindLastOf(event_ptrs, Query::Bool(false), 1000, &index));
811 EXPECT_TRUE(FindLastOf(event_ptrs, Query::Bool(true), 1000, &index));
813 EXPECT_TRUE(FindLastOf(event_ptrs, Query::Bool(true), num_events - 5,
829 EXPECT_FALSE(FindClosest(event_ptrs, Query::Bool(true), 0,
844 Query query_named = Query::EventName() != Query::String(std::string());
845 Query query_one = Query::EventName() == Query::String("one");
869 EXPECT_EQ(0u, CountMatches(event_ptrs, Query::Bool(true), 0, 10));
880 Query query_named = Query::EventName() != Query::String(std::string());
881 Query query_one = Query::EventName() == Query::String("one");
883 EXPECT_EQ(0u, CountMatches(event_ptrs, Query::Bool(false)));
884 EXPECT_EQ(num_events, CountMatches(event_ptrs, Query::Bool(true)));
885 EXPECT_EQ(num_events - 1, CountMatches(event_ptrs, Query::Bool(true),