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
334 do_query(query, 'CREATE VIEW machines_view AS '
339 'CASE WHEN id=0 THEN \'unknown\' WHEN pid=-1 THEN \'host\' ELSE \'guest\' END AS host_or_guest'
342 do_query(query, 'CREATE VIEW dsos_view AS '
346 '(SELECT host_or_guest FROM machines_view WHERE id = machine_id) AS host_or_guest,'
352 do_query(query, 'CREATE VIEW symbols_view AS '
356 '(SELECT short_name FROM dsos WHERE id=dso_id) AS dso,'
360 'CASE WHEN binding=0 THEN \'local\' WHEN binding=1 THEN \'global\' ELSE \'weak\' END AS binding'
363 do_query(query, 'CREATE VIEW threads_view AS '
367 '(SELECT host_or_guest FROM machines_view WHERE id = machine_id) AS host_or_guest,'
373 do_query(query, 'CREATE VIEW comm_threads_view AS '
376 '(SELECT comm FROM comms WHERE id = comm_id) AS command,'
378 '(SELECT pid FROM threads WHERE id = thread_id) AS pid,'
379 '(SELECT tid FROM threads WHERE id = thread_id) AS tid'
383 do_query(query, 'CREATE VIEW call_paths_view AS '
386 + emit_to_hex('c.ip') + ' AS ip,'
388 '(SELECT name FROM symbols WHERE id = c.symbol_id) AS symbol,'
389 '(SELECT dso_id FROM symbols WHERE id = c.symbol_id) AS dso_id,'
390 '(SELECT dso FROM symbols_view WHERE id = c.symbol_id) AS dso_short_name,'
392 + emit_to_hex('p.ip') + ' AS parent_ip,'
393 'p.symbol_id AS parent_symbol_id,'
394 '(SELECT name FROM symbols WHERE id = p.symbol_id) AS parent_symbol,'
395 '(SELECT dso_id FROM symbols WHERE id = p.symbol_id) AS parent_dso_id,'
396 '(SELECT dso FROM symbols_view WHERE id = p.symbol_id) AS parent_dso_short_name'
399 do_query(query, 'CREATE VIEW calls_view AS '
403 '(SELECT pid FROM threads WHERE id = thread_id) AS pid,'
404 '(SELECT tid FROM threads WHERE id = thread_id) AS tid,'
405 '(SELECT comm FROM comms WHERE id = comm_id) AS command,'
407 + emit_to_hex('ip') + ' AS ip,'
409 '(SELECT name FROM symbols WHERE id = symbol_id) AS symbol,'
412 'return_time - call_time AS elapsed_time,'
416 …'CASE WHEN cyc_count=0 THEN CAST(0 AS FLOAT) ELSE ROUND(CAST(insn_count AS FLOAT) / cyc_count, 2) …
419 … return\' WHEN flags=3 THEN \'no call/return\' WHEN flags=6 THEN \'jump\' ELSE flags END AS flags,'
424 do_query(query, 'CREATE VIEW samples_view AS '
429 '(SELECT pid FROM threads WHERE id = thread_id) AS pid,'
430 '(SELECT tid FROM threads WHERE id = thread_id) AS tid,'
431 '(SELECT comm FROM comms WHERE id = comm_id) AS command,'
432 '(SELECT name FROM selected_events WHERE id = evsel_id) AS event,'
433 + emit_to_hex('ip') + ' AS ip_hex,'
434 '(SELECT name FROM symbols WHERE id = symbol_id) AS symbol,'
436 '(SELECT short_name FROM dsos WHERE id = dso_id) AS dso_short_name,'
437 + emit_to_hex('to_ip') + ' AS to_ip_hex,'
438 '(SELECT name FROM symbols WHERE id = to_symbol_id) AS to_symbol,'
440 '(SELECT short_name FROM dsos WHERE id = to_dso_id) AS to_dso_short_name,'
441 '(SELECT name FROM branch_types WHERE id = branch_type) AS branch_type_name,'
445 …'CASE WHEN cyc_count=0 THEN CAST(0 AS FLOAT) ELSE ROUND(CAST(insn_count AS FLOAT) / cyc_count, 2) …
448 do_query(query, 'CREATE VIEW ptwrite_view AS '
453 + emit_to_hex('payload') + ' AS payload_hex,'
454 'CASE WHEN exact_ip=0 THEN \'False\' ELSE \'True\' END AS exact_ip'
458 do_query(query, 'CREATE VIEW cbr_view AS '
469 do_query(query, 'CREATE VIEW mwait_view AS '
474 + emit_to_hex('hints') + ' AS hints_hex,'
475 + emit_to_hex('extensions') + ' AS extensions_hex'
479 do_query(query, 'CREATE VIEW pwre_view AS '
486 'CASE WHEN hw=0 THEN \'False\' ELSE \'True\' END AS hw'
490 do_query(query, 'CREATE VIEW exstop_view AS '
495 'CASE WHEN exact_ip=0 THEN \'False\' ELSE \'True\' END AS exact_ip'
499 do_query(query, 'CREATE VIEW pwrx_view AS '
511 'END AS wake_reason'
515 do_query(query, 'CREATE VIEW power_events_view AS '
520 'selected_events.name AS event,'
521 …ected_events.name=\'cbr\' THEN (SELECT cbr FROM cbr WHERE cbr.id = samples.id) ELSE "" END AS cbr,'
522 …ected_events.name=\'cbr\' THEN (SELECT mhz FROM cbr WHERE cbr.id = samples.id) ELSE "" END AS mhz,'
523 …ents.name=\'cbr\' THEN (SELECT percent FROM cbr WHERE cbr.id = samples.id) ELSE "" END AS percent,'
524 …ECT ' + emit_to_hex('hints') + ' FROM mwait WHERE mwait.id = samples.id) ELSE "" END AS hints_hex,'
525 …it_to_hex('extensions') + ' FROM mwait WHERE mwait.id = samples.id) ELSE "" END AS extensions_hex,'
526 …nts.name=\'pwre\' THEN (SELECT cstate FROM pwre WHERE pwre.id = samples.id) ELSE "" END AS cstate,'
527 …me=\'pwre\' THEN (SELECT subcstate FROM pwre WHERE pwre.id = samples.id) ELSE "" END AS subcstate,'
528 …cted_events.name=\'pwre\' THEN (SELECT hw FROM pwre WHERE pwre.id = samples.id) ELSE "" END AS hw,'
529 …'exstop\' THEN (SELECT exact_ip FROM exstop WHERE exstop.id = samples.id) ELSE "" END AS exact_ip,'
530 …' THEN (SELECT deepest_cstate FROM pwrx WHERE pwrx.id = samples.id) ELSE "" END AS deepest_cstate,'
531 …'pwrx\' THEN (SELECT last_cstate FROM pwrx WHERE pwrx.id = samples.id) ELSE "" END AS last_cstate,'
539 ' FROM pwrx WHERE pwrx.id = samples.id) ELSE "" END AS wake_reason'
544 do_query(query, 'CREATE VIEW context_switches_view AS '
550 'th_out.pid AS pid_out,'
551 'th_out.tid AS tid_out,'
552 'comm_out.comm AS comm_out,'
553 'th_in.pid AS pid_in,'
554 'th_in.tid AS tid_in,'
555 'comm_in.comm AS comm_in,'
560 'END AS flags'
562 ' INNER JOIN threads AS th_out ON th_out.id = context_switches.thread_out_id'
563 ' INNER JOIN threads AS th_in ON th_in.id = context_switches.thread_in_id'
564 ' INNER JOIN comms AS comm_out ON comm_out.id = context_switches.comm_out_id'
565 ' INNER JOIN comms AS comm_in ON comm_in.id = context_switches.comm_in_id')