python_code
stringlengths
0
679k
repo_name
stringlengths
9
41
file_path
stringlengths
6
149
""" QAPI types generator Copyright IBM, Corp. 2011 Copyright (c) 2013-2018 Red Hat Inc. Authors: Anthony Liguori <aliguori@us.ibm.com> Michael Roth <mdroth@linux.vnet.ibm.com> Markus Armbruster <armbru@redhat.com> This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-l...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qapi/types.py
""" QAPI introspection generator Copyright (C) 2015-2021 Red Hat, Inc. Authors: Markus Armbruster <armbru@redhat.com> John Snow <jsnow@redhat.com> This work is licensed under the terms of the GNU GPL, version 2. See the COPYING file in the top-level directory. """ from typing import ( Any, Dict, Gener...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qapi/introspect.py
# -*- coding: utf-8 -*- # # QAPI schema parser # # Copyright IBM, Corp. 2011 # Copyright (c) 2013-2019 Red Hat Inc. # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # Markus Armbruster <armbru@redhat.com> # Marc-André Lureau <marcandre.lureau@redhat.com> # Kevin Wolf <kwolf@redhat.com> # # This work is licensed...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qapi/parser.py
# # QAPI helper library # # Copyright IBM, Corp. 2011 # Copyright (c) 2013-2018 Red Hat Inc. # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # Markus Armbruster <armbru@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. import re f...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qapi/common.py
# This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. """ QAPI Generator This is the main entry point for generating C code from the QAPI schema. """ import argparse import sys from typing import Optional from .commands import gen_commands fro...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qapi/main.py
# # QAPI frontend source file info # # Copyright (c) 2019 Red Hat Inc. # # Authors: # Markus Armbruster <armbru@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. import copy from typing import List, Optional, TypeVar class QAPISchemaP...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qapi/source.py
""" QAPI command marshaller generator Copyright IBM, Corp. 2011 Copyright (C) 2014-2018 Red Hat, Inc. Authors: Anthony Liguori <aliguori@us.ibm.com> Michael Roth <mdroth@linux.vnet.ibm.com> Markus Armbruster <armbru@redhat.com> This work is licensed under the terms of the GNU GPL, version 2. See the COPYING file ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qapi/commands.py
# -*- coding: utf-8 -*- # # QAPI schema internal representation # # Copyright (c) 2015-2019 Red Hat Inc. # # Authors: # Markus Armbruster <armbru@redhat.com> # Eric Blake <eblake@redhat.com> # Marc-André Lureau <marcandre.lureau@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. # See t...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qapi/schema.py
# -*- coding: utf-8 -*- # # Copyright IBM, Corp. 2011 # Copyright (c) 2013-2021 Red Hat Inc. # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # Markus Armbruster <armbru@redhat.com> # Eric Blake <eblake@redhat.com> # Marc-André Lureau <marcandre.lureau@redhat.com> # John Snow <jsnow@redhat.com> # # This work i...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qapi/expr.py
# -*- coding: utf-8 -*- """ Generic management for the 'vcpu' property. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2016, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __emai...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/vcpu.py
# -*- coding: utf-8 -*- """ Machinery for generating tracing-related intermediate files. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "St...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/__init__.py
# -*- coding: utf-8 -*- """ Type-transformation rules. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "s...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/transform.py
# -*- coding: utf-8 -*- """ DTrace/SystemTAP backend. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "st...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/backend/dtrace.py
# -*- coding: utf-8 -*- """ Stderr built-in backend. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "ste...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/backend/log.py
# -*- coding: utf-8 -*- """ Backend management. Creating new backends --------------------- A new backend named 'foo-bar' corresponds to Python module 'tracetool/backend/foo_bar.py'. A backend module should provide a docstring, whose first non-empty line will be considered its short description. All backends must...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/backend/__init__.py
# -*- coding: utf-8 -*- """ Ftrace built-in backend. """ __author__ = "Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com>" __copyright__ = "Copyright (C) 2013 Hitachi, Ltd." __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "stefanha@redhat.co...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/backend/ftrace.py
# -*- coding: utf-8 -*- """ LTTng User Space Tracing backend. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/backend/ust.py
# -*- coding: utf-8 -*- """ Syslog built-in backend. """ __author__ = "Paul Durrant <paul.durrant@citrix.com>" __copyright__ = "Copyright 2016, Citrix Systems Inc." __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "stefanha@redhat.com" ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/backend/syslog.py
# -*- coding: utf-8 -*- """ Simple built-in backend. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "ste...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/backend/simple.py
# -*- coding: utf-8 -*- """ trace/generated-ust-provider.h """ __author__ = "Mohamad Gebai <mohamad.gebai@polymtl.ca>" __copyright__ = "Copyright 2012, Mohamad Gebai <mohamad.gebai@polymtl.ca>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/ust_events_h.py
# -*- coding: utf-8 -*- """ trace/generated-ust.c """ __author__ = "Mohamad Gebai <mohamad.gebai@polymtl.ca>" __copyright__ = "Copyright 2012, Mohamad Gebai <mohamad.gebai@polymtl.ca>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "ste...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/ust_events_c.py
# -*- coding: utf-8 -*- """ Format management. Creating new formats -------------------- A new format named 'foo-bar' corresponds to Python module 'tracetool/format/foo_bar.py'. A format module should provide a docstring, whose first non-empty line will be considered its short description. All formats must genera...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/__init__.py
# -*- coding: utf-8 -*- """ trace/generated-tracers.dtrace (DTrace only). """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/d.py
# -*- coding: utf-8 -*- """ Generate trace/generated-helpers-wrappers.h. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" _...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/tcg_helper_wrapper_h.py
# -*- coding: utf-8 -*- """ Generate trace/generated-helpers.h. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/tcg_helper_h.py
# -*- coding: utf-8 -*- """ trace/generated-tracers.c """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "st...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/c.py
# -*- coding: utf-8 -*- """ Generate .h file for TCG code generation. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __em...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/tcg_h.py
# -*- coding: utf-8 -*- """ Generate .stp file (DTrace with SystemTAP only). """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnocz...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/stap.py
# -*- coding: utf-8 -*- """ Generate .stp file that printfs log messages (DTrace with SystemTAP only). """ __author__ = "Daniel P. Berrange <berrange@redhat.com>" __copyright__ = "Copyright (C) 2014-2019, Red Hat, Inc." __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Dan...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/log_stap.py
# -*- coding: utf-8 -*- """ Generate .stp file that outputs simpletrace binary traces (DTrace with SystemTAP only). """ __author__ = "Stefan Hajnoczi <redhat.com>" __copyright__ = "Copyright (C) 2014, Red Hat, Inc." __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/simpletrace_stap.py
# -*- coding: utf-8 -*- """ Generate trace/generated-helpers.c. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/tcg_helper_c.py
# -*- coding: utf-8 -*- """ trace/generated-tracers.h """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "st...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/tracetool/format/h.py
#!/usr/bin/env python3 # QEMU library # # Copyright (C) 2020 Red Hat Inc. # # Authors: # Eduardo Habkost <ehabkost@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. # import sys import argparse import os import os.path import re from ty...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/codeconverter/converter.py
# Copyright (C) 2020 Red Hat Inc. # # Authors: # Eduardo Habkost <ehabkost@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. import re from .regexps import * from .patching import * from .utils import * from .qom_macros import * TI_FIE...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/codeconverter/codeconverter/qom_type_info.py
# Copyright (C) 2020 Red Hat Inc. # # Authors: # Eduardo Habkost <ehabkost@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. from tempfile import NamedTemporaryFile from .patching import FileInfo, FileMatch, Patch, FileList from .regexp...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/codeconverter/codeconverter/test_patching.py
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/codeconverter/codeconverter/__init__.py
# Copyright (C) 2020 Red Hat Inc. # # Authors: # Eduardo Habkost <ehabkost@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. import re from itertools import chain from typing import * from .regexps import * from .patching import * from...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/codeconverter/codeconverter/qom_macros.py
# Copyright (C) 2020 Red Hat Inc. # # Authors: # Eduardo Habkost <ehabkost@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. from typing import IO, Match, NamedTuple, Optional, Literal, Iterable, Type, Dict, List, Any, TypeVar, NewType,...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/codeconverter/codeconverter/patching.py
# Copyright (C) 2020 Red Hat Inc. # # Authors: # Eduardo Habkost <ehabkost@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. from .regexps import * from .qom_macros import * from .qom_type_info import * def test_res() -> None: def ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/codeconverter/codeconverter/test_regexps.py
# Copyright (C) 2020 Red Hat Inc. # # Authors: # Eduardo Habkost <ehabkost@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. from typing import * import logging logger = logging.getLogger(__name__) DBG = logger.debug INFO = logger.info...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/codeconverter/codeconverter/utils.py
# Copyright (C) 2020 Red Hat Inc. # # Authors: # Eduardo Habkost <ehabkost@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. """Helpers for creation of regular expressions""" import re import logging logger = logging.getLogger(__name__...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/codeconverter/codeconverter/regexps.py
# # GDB debugging support # # Copyright (c) 2015 Linaro Ltd # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This p...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qemugdb/__init__.py
# # GDB debugging support # # Copyright 2012 Red Hat, Inc. and/or its affiliates # # Authors: # Avi Kivity <avi@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2 # or later. See the COPYING file in the top-level directory. import gdb VOID_PTR = gdb.lookup_type('void').pointer() def ge...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qemugdb/coroutine.py
# # GDB debugging support: aio/iohandler debug # # Copyright (c) 2015 Red Hat, Inc. # # Author: Dr. David Alan Gilbert <dgilbert@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. # import gdb from qemugdb import coroutine def ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qemugdb/aio.py
# -*- coding: utf-8 -*- # GDB debugging support # # Copyright 2017 Linaro Ltd # # Author: Alex Bennée <alex.bennee@linaro.org> # # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. # # SPDX-License-Identifier: GPL-2.0-or-later # 'qemu timers' -...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qemugdb/timers.py
# # GDB debugging support # # Copyright 2012 Red Hat, Inc. and/or its affiliates # # Authors: # Avi Kivity <avi@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. # 'qemu mtree' -- display the memory hierarchy import gdb def ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qemugdb/mtree.py
# -*- coding: utf-8 -*- # # GDB debugging support, TCG status # # Copyright 2016 Linaro Ltd # # Authors: # Alex Bennée <alex.bennee@linaro.org> # # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. # 'qemu tcg-lock-status' -- display the TCG ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/qemugdb/tcg.py
#!/usr/bin/env python3 # Print the percentage of instructions spent in each phase of QEMU # execution. # # Syntax: # dissect.py [-h] -- <qemu executable> [<qemu executable options>] \ # <target executable> [<target executable options>] # # [-h] - Print the script arguments help message. # # Exa...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/performance/dissect.py
#!/usr/bin/env python3 # Print the top N most executed functions in QEMU using perf. # Syntax: # topN_perf.py [-h] [-n] <number of displayed top functions> -- \ # <qemu executable> [<qemu executable options>] \ # <target executable> [<target execurable options>] # # [-h] - Print the script arg...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/performance/topN_perf.py
#!/usr/bin/env python3 # Print the top N most executed functions in QEMU using callgrind. # Syntax: # topN_callgrind.py [-h] [-n] <number of displayed top functions> -- \ # <qemu executable> [<qemu executable options>] \ # <target executable> [<target execurable options>] # # [-h] - Print the ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/performance/topN_callgrind.py
#!/usr/bin/env python3 # # Module information generator # # Copyright Red Hat, Inc. 2015 - 2016 # # Authors: # Marc Mari <markmb@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. import sys import os def get_string_struct(line): da...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/modules/module_block.py
#!/usr/bin/env python3 # # Simple benchmarking framework # # Copyright (c) 2019 Virtuozzo International GmbH. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, o...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/simplebench/results_to_text.py
# Parser for test templates # # Copyright (c) 2021 Virtuozzo International GmbH. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any late...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/simplebench/table_templater.py
#!/usr/bin/env python3 # # Benchmark preallocate filter # # Copyright (c) 2020 Virtuozzo International GmbH. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/simplebench/bench_prealloc.py
#!/usr/bin/env python3 # # Benchmark block jobs # # Copyright (c) 2019 Virtuozzo International GmbH. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at y...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/simplebench/bench_block_job.py
#!/usr/bin/env python3 # # Process img-bench test templates # # Copyright (c) 2021 Virtuozzo International GmbH. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/simplebench/img_bench_templater.py
#!/usr/bin/env python # # Simple benchmarking framework # # Copyright (c) 2019 Virtuozzo International GmbH. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/simplebench/simplebench.py
#!/usr/bin/env python3 # # Test to compare performance of write requests for two qemu-img binary files. # # The idea of the test comes from intention to check the benefit of c8bb23cbdbe # "qcow2: skip writing zero buffers to empty COW areas". # # Copyright (c) 2020 Virtuozzo International GmbH. # # This program is free...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/simplebench/bench_write_req.py
#!/usr/bin/env python3 # # Benchmark example # # Copyright (c) 2019 Virtuozzo International GmbH. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/simplebench/bench-example.py
#!/usr/bin/env python3 # # Bench backup block-job # # Copyright (c) 2020 Virtuozzo International GmbH. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/simplebench/bench-backup.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Convert plain qtest traces to C or Bash reproducers Use this to help build bug-reports or create in-tree reproducers for bugs. Note: This will not format C code for you. Pipe the output through clang-format -style="{BasedOnStyle: llvm, IndentWidth: 4, ColumnLimit: 90...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/oss-fuzz/output_reproducer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This takes a crashing qtest trace and tries to remove superflous operations """ import sys import os import subprocess import time import struct QEMU_ARGS = None QEMU_PATH = None TIMEOUT = 5 CRASH_TOKEN = None # Minimization levels M1 = False # try removing IO comm...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/oss-fuzz/minimize_qtest_trace.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Use this to convert qtest log info from a generic fuzzer input into a qtest trace that you can feed into a standard qemu-system process. Example usage: QEMU_FUZZ_ARGS="-machine q35,accel=qtest" QEMU_FUZZ_OBJECTS="*" \ ./i386-softmmu/qemu-fuzz-i386 --fuzz-targ...
nvtrust-main
infrastructure/kvm/qemu/qemu_source/scripts/oss-fuzz/reorder_fuzzer_qtest_trace.py
# -*- coding: utf-8 -*- # # The Linux Kernel documentation build configuration file, created by # sphinx-quickstart on Fri Feb 12 13:51:46 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated fi...
nvtrust-main
infrastructure/linux/linux_source/Documentation/conf.py
#!/usr/bin/env python # add symbolic names to read_msr / write_msr in trace # decode_msr msr-index.h < trace import sys import re msrs = dict() with open(sys.argv[1] if len(sys.argv) > 1 else "msr-index.h", "r") as f: for j in f: m = re.match(r'#define (MSR_\w+)\s+(0x[0-9a-fA-F]+)', j) if m: msrs[int(m.group(...
nvtrust-main
infrastructure/linux/linux_source/Documentation/trace/postprocess/decode_msr.py
#!/usr/bin/env python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric...
nvtrust-main
infrastructure/linux/linux_source/Documentation/target/tcm_mod_builder.py
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
nvtrust-main
infrastructure/linux/linux_source/Documentation/networking/device_drivers/atm/cxacru-cf.py
# coding=utf-8 # SPDX-License-Identifier: GPL-2.0 # u""" kernel-feat ~~~~~~~~~~~ Implementation of the ``kernel-feat`` reST-directive. :copyright: Copyright (C) 2016 Markus Heiser :copyright: Copyright (C) 2016-2019 Mauro Carvalho Chehab :maintained-by: Mauro Carvalho Chehab <mchehab+samsu...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/kernel_feat.py
# -*- coding: utf-8; mode: python -*- # pylint: disable=W0141,C0113,C0103,C0325 u""" cdomain ~~~~~~~ Replacement for the sphinx c-domain. :copyright: Copyright (C) 2016 Markus Heiser :license: GPL Version 2, June 1991 see Linux/COPYING for details. List of customizations: * Moved th...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/cdomain.py
#!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- # pylint: disable=R0903, C0330, R0914, R0912, E0401 u""" kernel-include ~~~~~~~~~~~~~~ Implementation of the ``kernel-include`` reST-directive. :copyright: Copyright (C) 2016 Markus Heiser :license: GPL Version 2, June 1991 see lin...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/kernel_include.py
#!/usr/bin/env python # SPDX-License-Identifier: GPL-2.0 # -*- coding: utf-8; mode: python -*- # pylint: disable=R0903, C0330, R0914, R0912, E0401 u""" maintainers-include ~~~~~~~~~~~~~~~~~~~ Implementation of the ``maintainers-include`` reST-directive. :copyright: Copyright (C) 2019 Kees Cook <kee...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/maintainers_include.py
# -*- coding: utf-8; mode: python -*- # coding=utf-8 # SPDX-License-Identifier: GPL-2.0 # u""" kernel-abi ~~~~~~~~~~ Implementation of the ``kernel-abi`` reST-directive. :copyright: Copyright (C) 2016 Markus Heiser :copyright: Copyright (C) 2016-2020 Mauro Carvalho Chehab :maintained-by: M...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/kernel_abi.py
#!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- # pylint: disable=C0330, R0903, R0912 u""" flat-table ~~~~~~~~~~ Implementation of the ``flat-table`` reST-directive. :copyright: Copyright (C) 2016 Markus Heiser :license: GPL Version 2, June 1991 see linux/COPYING for details. ...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/rstFlatTable.py
# SPDX-License-Identifier: GPL-2.0 # # Sphinx has deprecated its older logging interface, but the replacement # only goes back to 1.6. So here's a wrapper layer to keep around for # as long as we support 1.4. # # We don't support 1.4 anymore, but we'll keep the wrappers around until # we change all the code to not use...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/kernellog.py
# -*- coding: utf-8; mode: python -*- # pylint: disable=R0903, C0330, R0914, R0912, E0401 import os import sys from sphinx.util.pycompat import execfile_ # ------------------------------------------------------------------------------ def loadConfig(namespace): # ------------------------------------------------------...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/load_config.py
# SPDX-License-Identifier: GPL-2.0 # Copyright 2019 Jonathan Corbet <corbet@lwn.net> # # Apply kernel-specific tweaks after the initial document processing # has been done. # from docutils import nodes import sphinx from sphinx import addnodes if sphinx.version_info[0] < 2 or \ sphinx.version_info[0] == 2 and sphinx...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/automarkup.py
# coding=utf-8 # # Copyright © 2016 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, me...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/kerneldoc.py
# -*- coding: utf-8; mode: python -*- # pylint: disable=C0103, R0903, R0912, R0915 u""" scalable figure and image handling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sphinx extension which implements scalable image handling. :copyright: Copyright (C) 2016 Markus Heiser :license: GPL Version 2, June 1...
nvtrust-main
infrastructure/linux/linux_source/Documentation/sphinx/kfigure.py
# -*- coding: utf-8; mode: python -*- # SPDX-License-Identifier: GPL-2.0 project = 'Linux Media Subsystem Documentation' # It is possible to run Sphinx in nickpick mode with: nitpicky = True # within nit-picking build, do not refer to any intersphinx object intersphinx_mapping = {} # In nickpick mode, it will comp...
nvtrust-main
infrastructure/linux/linux_source/Documentation/userspace-api/media/conf_nitpick.py
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only # # Tool for analyzing boot timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free...
nvtrust-main
infrastructure/linux/linux_source/tools/power/pm-graph/bootgraph.py
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published b...
nvtrust-main
infrastructure/linux/linux_source/tools/power/pm-graph/sleepgraph.py
#!/usr/bin/env python # SPDX-License-Identifier: GPL-2.0-only # -*- coding: utf-8 -*- # """ This utility can be used to debug and tune the performance of the intel_pstate driver. This utility can be used in two ways: - If there is Linux trace file with pstate_sample events enabled, then this utility can parse the trace...
nvtrust-main
infrastructure/linux/linux_source/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only # -*- coding: utf-8 -*- # """ This utility can be used to debug and tune the performance of the AMD P-State driver. It imports intel_pstate_tracer to analyze AMD P-State trace event. Prerequisites: Python version 2.7.x or higher gnuplot 5.0 or high...
nvtrust-main
infrastructure/linux/linux_source/tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py
#!/usr/bin/env drgn # # Copyright (C) 2020 Roman Gushchin <guro@fb.com> # Copyright (C) 2020 Facebook from os import stat import argparse import sys from drgn.helpers.linux import list_for_each_entry, list_empty from drgn.helpers.linux import for_each_page from drgn.helpers.linux.cpumask import for_each_online_cpu fr...
nvtrust-main
infrastructure/linux/linux_source/tools/cgroup/memcg_slabinfo.py
#!/usr/bin/env python3 # # Copyright (C) 2019 Tejun Heo <tj@kernel.org> # Copyright (C) 2019 Andy Newell <newella@fb.com> # Copyright (C) 2019 Facebook desc = """ Generate linear IO cost model coefficients used by the blk-iocost controller. If the target raw testdev is specified, destructive tests are performed again...
nvtrust-main
infrastructure/linux/linux_source/tools/cgroup/iocost_coef_gen.py
#!/usr/bin/env drgn # # Copyright (C) 2019 Tejun Heo <tj@kernel.org> # Copyright (C) 2019 Facebook desc = """ This is a drgn script to monitor the blk-iocost cgroup controller. See the comment at the top of block/blk-iocost.c for more details. For drgn, visit https://github.com/osandov/drgn. """ import sys import re ...
nvtrust-main
infrastructure/linux/linux_source/tools/cgroup/iocost_monitor.py
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 from subprocess import PIPE, Popen import json import time import argparse import collections import sys # # Test port split configuration using devlink-port lanes attribute. # The test is skipped in case the attribute is not available. # # First, check that a...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/net/devlink_port_split.py
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 from struct import pack from time import sleep import errno import glob import os import subprocess try: import pytest except ImportError: print("Unable to import pytest python module.") print("\nIf not already installed, you may do so with:") ...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/drivers/sdsi/sdsi_test.py
#!/usr/bin/env python # SPDX-License-Identifier: GPL-2.0 import subprocess import json as j import random class SkipTest(Exception): pass class RandomValuePicker: """ Class for storing shared buffer configuration. Can handle 3 different objects, pool, tcbind and portpool. Provide an interface to ge...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/drivers/net/mlxsw/sharedbuffer_configuration.py
#!/usr/bin/env python3 from enum import Enum class ResultState(Enum): noresult = -1 skip = 0 success = 1 fail = 2 class TestResult: def __init__(self, test_id="", test_name=""): self.test_id = test_id self.test_name = test_name self.result = ResultState.noresult self.f...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/TdcResults.py
""" tdc_config_local.py - tdc plugin-writer-specified values Copyright (C) 2017 bjb@mojatatu.com """ import os ENVIR = os.environ.copy() ENV_LD_LIBRARY_PATH = os.getenv('LD_LIBRARY_PATH', '') ENV_OTHER_LIB = os.getenv('OTHER_LIB', '') # example adding value to NAMES, without editing tdc_config.py EXTRA_NAMES = di...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/tdc_config_local_template.py
#!/usr/bin/env python3 class TdcPlugin: def __init__(self): super().__init__() print(' -- {}.__init__'.format(self.sub_class)) def pre_suite(self, testcount, testidlist): '''run commands before test_runner goes into a test loop''' self.testcount = testcount self.testidl...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/TdcPlugin.py
""" # SPDX-License-Identifier: GPL-2.0 tdc_helper.py - tdc helper functions Copyright (C) 2017 Lucas Bates <lucasb@mojatatu.com> """ def get_categorized_testlist(alltests, ucat): """ Sort the master test list into categories. """ testcases = dict() for category in ucat: testcases[category] = list...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/tdc_helper.py
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 """ tdc_multibatch.py - a thin wrapper over tdc_batch.py to generate multiple batch files Copyright (C) 2019 Vlad Buslov <vladbu@mellanox.com> """ import argparse import os parser = argparse.ArgumentParser( description='TC multiple batch file generator') ...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/tdc_multibatch.py
#!/usr/bin/env python3 """ tdc_batch.py - a script to generate TC batch file Copyright (C) 2017 Chris Mi <chrism@mellanox.com> """ import argparse parser = argparse.ArgumentParser(description='TC batch file generator') parser.add_argument("device", help="device name") parser.add_argument("file", help="batch file na...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/tdc_batch.py
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 """ tdc.py - Linux tc (Traffic Control) unit test driver Copyright (C) 2017 Lucas Bates <lucasb@mojatatu.com> """ import re import os import sys import argparse import importlib import json import subprocess import time import traceback from collections impor...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/tdc.py
""" # SPDX-License-Identifier: GPL-2.0 tdc_config.py - tdc user-specified values Copyright (C) 2017 Lucas Bates <lucasb@mojatatu.com> """ # Dictionary containing all values that can be substituted in executable # commands. NAMES = { # Substitute your own tc path here 'TC': '/sbin/tc', # ...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/tdc_config.py
''' build ebpf program ''' import os import signal from string import Template import subprocess import time from TdcPlugin import TdcPlugin from tdc_config import * class SubPlugin(TdcPlugin): def __init__(self): self.sub_class = 'buildebpf/SubPlugin' self.tap = '' super().__init__() ...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/plugin-lib/buildebpfPlugin.py
import os import signal from string import Template import subprocess import time from TdcPlugin import TdcPlugin from tdc_config import * class SubPlugin(TdcPlugin): def __init__(self): self.sub_class = 'ns/SubPlugin' super().__init__() def pre_suite(self, testcount, testidlist): '''...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/plugin-lib/nsPlugin.py
#!/usr/bin/env python3 import os import signal from string import Template import subprocess import time from TdcPlugin import TdcPlugin from tdc_config import * try: from scapy.all import * except ImportError: print("Unable to import the scapy python module.") print("\nIf not already installed, you may ...
nvtrust-main
infrastructure/linux/linux_source/tools/testing/selftests/tc-testing/plugin-lib/scapyPlugin.py