Lines Matching full:as

6 # version 2, as published by the Free Software Foundation.
67 # The database structure is practically the same as created by the script
336 do_query(query, 'CREATE VIEW machines_view AS '
341 'CASE WHEN id=0 THEN \'unknown\' WHEN pid=-1 THEN \'host\' ELSE \'guest\' END AS host_or_guest'
344 do_query(query, 'CREATE VIEW dsos_view AS '
348 '(SELECT host_or_guest FROM machines_view WHERE id = machine_id) AS host_or_guest,'
354 do_query(query, 'CREATE VIEW symbols_view AS '
358 '(SELECT short_name FROM dsos WHERE id=dso_id) AS dso,'
362 'CASE WHEN binding=0 THEN \'local\' WHEN binding=1 THEN \'global\' ELSE \'weak\' END AS binding'
365 do_query(query, 'CREATE VIEW threads_view AS '
369 '(SELECT host_or_guest FROM machines_view WHERE id = machine_id) AS host_or_guest,'
375 do_query(query, 'CREATE VIEW comm_threads_view AS '
378 '(SELECT comm FROM comms WHERE id = comm_id) AS command,'
380 '(SELECT pid FROM threads WHERE id = thread_id) AS pid,'
381 '(SELECT tid FROM threads WHERE id = thread_id) AS tid'
385 do_query(query, 'CREATE VIEW call_paths_view AS '
388 + emit_to_hex('c.ip') + ' AS ip,'
390 '(SELECT name FROM symbols WHERE id = c.symbol_id) AS symbol,'
391 '(SELECT dso_id FROM symbols WHERE id = c.symbol_id) AS dso_id,'
392 '(SELECT dso FROM symbols_view WHERE id = c.symbol_id) AS dso_short_name,'
394 + emit_to_hex('p.ip') + ' AS parent_ip,'
395 'p.symbol_id AS parent_symbol_id,'
396 '(SELECT name FROM symbols WHERE id = p.symbol_id) AS parent_symbol,'
397 '(SELECT dso_id FROM symbols WHERE id = p.symbol_id) AS parent_dso_id,'
398 '(SELECT dso FROM symbols_view WHERE id = p.symbol_id) AS parent_dso_short_name'
401 do_query(query, 'CREATE VIEW calls_view AS '
405 '(SELECT pid FROM threads WHERE id = thread_id) AS pid,'
406 '(SELECT tid FROM threads WHERE id = thread_id) AS tid,'
407 '(SELECT comm FROM comms WHERE id = comm_id) AS command,'
409 + emit_to_hex('ip') + ' AS ip,'
411 '(SELECT name FROM symbols WHERE id = symbol_id) AS symbol,'
414 'return_time - call_time AS elapsed_time,'
418 …'CASE WHEN cyc_count=0 THEN CAST(0 AS FLOAT) ELSE ROUND(CAST(insn_count AS FLOAT) / cyc_count, 2) …
421 … return\' WHEN flags=3 THEN \'no call/return\' WHEN flags=6 THEN \'jump\' ELSE flags END AS flags,'
426 do_query(query, 'CREATE VIEW samples_view AS '
431 '(SELECT pid FROM threads WHERE id = thread_id) AS pid,'
432 '(SELECT tid FROM threads WHERE id = thread_id) AS tid,'
433 '(SELECT comm FROM comms WHERE id = comm_id) AS command,'
434 '(SELECT name FROM selected_events WHERE id = evsel_id) AS event,'
435 + emit_to_hex('ip') + ' AS ip_hex,'
436 '(SELECT name FROM symbols WHERE id = symbol_id) AS symbol,'
438 '(SELECT short_name FROM dsos WHERE id = dso_id) AS dso_short_name,'
439 + emit_to_hex('to_ip') + ' AS to_ip_hex,'
440 '(SELECT name FROM symbols WHERE id = to_symbol_id) AS to_symbol,'
442 '(SELECT short_name FROM dsos WHERE id = to_dso_id) AS to_dso_short_name,'
443 '(SELECT name FROM branch_types WHERE id = branch_type) AS branch_type_name,'
447 …'CASE WHEN cyc_count=0 THEN CAST(0 AS FLOAT) ELSE ROUND(CAST(insn_count AS FLOAT) / cyc_count, 2) …
451 do_query(query, 'CREATE VIEW ptwrite_view AS '
456 + emit_to_hex('payload') + ' AS payload_hex,'
457 'CASE WHEN exact_ip=0 THEN \'False\' ELSE \'True\' END AS exact_ip'
461 do_query(query, 'CREATE VIEW cbr_view AS '
472 do_query(query, 'CREATE VIEW mwait_view AS '
477 + emit_to_hex('hints') + ' AS hints_hex,'
478 + emit_to_hex('extensions') + ' AS extensions_hex'
482 do_query(query, 'CREATE VIEW pwre_view AS '
489 'CASE WHEN hw=0 THEN \'False\' ELSE \'True\' END AS hw'
493 do_query(query, 'CREATE VIEW exstop_view AS '
498 'CASE WHEN exact_ip=0 THEN \'False\' ELSE \'True\' END AS exact_ip'
502 do_query(query, 'CREATE VIEW pwrx_view AS '
514 'END AS wake_reason'
518 do_query(query, 'CREATE VIEW power_events_view AS '
523 'selected_events.name AS event,'
524 …ected_events.name=\'cbr\' THEN (SELECT cbr FROM cbr WHERE cbr.id = samples.id) ELSE "" END AS cbr,'
525 …ected_events.name=\'cbr\' THEN (SELECT mhz FROM cbr WHERE cbr.id = samples.id) ELSE "" END AS mhz,'
526 …ents.name=\'cbr\' THEN (SELECT percent FROM cbr WHERE cbr.id = samples.id) ELSE "" END AS percent,'
527 …ECT ' + emit_to_hex('hints') + ' FROM mwait WHERE mwait.id = samples.id) ELSE "" END AS hints_hex,'
528 …it_to_hex('extensions') + ' FROM mwait WHERE mwait.id = samples.id) ELSE "" END AS extensions_hex,'
529 …nts.name=\'pwre\' THEN (SELECT cstate FROM pwre WHERE pwre.id = samples.id) ELSE "" END AS cstate,'
530 …me=\'pwre\' THEN (SELECT subcstate FROM pwre WHERE pwre.id = samples.id) ELSE "" END AS subcstate,'
531 …cted_events.name=\'pwre\' THEN (SELECT hw FROM pwre WHERE pwre.id = samples.id) ELSE "" END AS hw,'
532 …'exstop\' THEN (SELECT exact_ip FROM exstop WHERE exstop.id = samples.id) ELSE "" END AS exact_ip,'
533 …' THEN (SELECT deepest_cstate FROM pwrx WHERE pwrx.id = samples.id) ELSE "" END AS deepest_cstate,'
534 …'pwrx\' THEN (SELECT last_cstate FROM pwrx WHERE pwrx.id = samples.id) ELSE "" END AS last_cstate,'
542 ' FROM pwrx WHERE pwrx.id = samples.id) ELSE "" END AS wake_reason'
547 do_query(query, 'CREATE VIEW context_switches_view AS '
553 'th_out.pid AS pid_out,'
554 'th_out.tid AS tid_out,'
555 'comm_out.comm AS comm_out,'
556 'th_in.pid AS pid_in,'
557 'th_in.tid AS tid_in,'
558 'comm_in.comm AS comm_in,'
563 'END AS flags'
565 ' INNER JOIN threads AS th_out ON th_out.id = context_switches.thread_out_id'
566 ' INNER JOIN threads AS th_in ON th_in.id = context_switches.thread_in_id'
567 ' INNER JOIN comms AS comm_out ON comm_out.id = context_switches.comm_out_id'
568 ' INNER JOIN comms AS comm_in ON comm_in.id = context_switches.comm_in_id')