02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

30 Jan, 2016

3 commits

  • perf kvm can be used to analyze guest exit reasons. This support already
    exists in x86. Hence, porting it to powerpc.

    - To trace KVM events :
    perf kvm stat record
    If many guests are running, we can track for a specific guest by using
    --pid as in : perf kvm stat record --pid

    - To see the results :
    perf kvm stat report

    The result shows the number of exits (from the guest context to
    host/hypervisor context) grouped by their respective exit reasons with
    their frequency.

    Since, different powerpc machines have different KVM tracepoints, this
    patch discovers the available tracepoints dynamically and accordingly
    looks for them. If any single tracepoint is not present, this support
    won't be enabled for reporting. To record, this will fail if any of the
    events we are looking to record isn't available. Right now, its only
    supported on PowerPC Book3S_HV architectures.

    To analyze the different exits, group them and present them (in a slight
    descriptive way) to the user, we need a mapping between the "exit code"
    (dumped in the kvm_guest_exit tracepoint data) and to its related
    Interrupt vector description (exit reason). This patch adds this mapping
    in book3s_hv_exits.h.

    It records on two available KVM tracepoints for book3s_hv:

    "kvm_hv:kvm_guest_exit" and "kvm_hv:kvm_guest_enter".

    Here is a sample o/p:
    # pgrep qemu
    19378
    60515

    2 Guests are running on the host.

    # perf kvm stat record -a
    ^C[ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 4.153 MB perf.data.guest (39624
    samples) ]

    # perf kvm stat report -p 60515

    Analyze events for pid(s) 60515, all VCPUs:

    VM-EXIT Samples Samples% Time% MinTime MaxTime Avg time

    SYSCALL 9141 63.67% 7.49% 1.26us 5782.39us 9.87us (+- 6.46%)
    H_DATA_STORAGE 4114 28.66% 5.07% 1.72us 4597.68us 14.84us (+-20.06%)
    HV_DECREMENTER 418 2.91% 4.26% 0.70us 30002.22us 122.58us (+-70.29%)
    EXTERNAL 392 2.73% 0.06% 0.64us 104.10us 1.94us (+-18.83%)
    RETURN_TO_HOST 287 2.00% 83.11% 1.53us 124240.15us 3486.52us (+-16.81%)
    H_INST_STORAGE 5 0.03% 0.00% 1.88us 3.73us 2.39us (+-14.20%)

    Total Samples:14357, Total events handled time:1203918.42us.

    Signed-off-by: Hemant Kumar
    Cc: Alexander Yarygin
    Cc: David Ahern
    Cc: Michael Ellerman
    Cc: Naveen N. Rao
    Cc: Paul Mackerras
    Cc: Scott Wood
    Cc: Srikar Dronamraju
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/1453962787-15376-3-git-send-email-hemant@linux.vnet.ibm.com
    Signed-off-by: Srikar Dronamraju
    Signed-off-by: Arnaldo Carvalho de Melo

    Hemant Kumar
     
  • This patch removes the "const" qualifier from kvm_events_tp declaration
    to account for the fact that some architectures may need to update this
    variable dynamically. For instance, powerpc will need to update this
    variable dynamically depending on the machine type.

    Signed-off-by: Hemant Kumar
    Acked-by: David Ahern
    Cc: Alexander Yarygin
    Cc: Michael Ellerman
    Cc: Naveen N. Rao
    Cc: Paul Mackerras
    Cc: Scott Wood
    Cc: Srikar Dronamraju
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/1453962787-15376-2-git-send-email-hemant@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Hemant Kumar
     
  • Its better to remove the dependency on uapi/kvm_perf.h to allow dynamic
    discovery of kvm events (if its needed). To do this, some extern
    variables have been introduced with which we can keep the generic
    functions generic.

    Signed-off-by: Hemant Kumar
    Acked-by: Alexander Yarygin
    Acked-by: David Ahern
    Cc: Michael Ellerman
    Cc: Naveen N. Rao
    Cc: Paul Mackerras
    Cc: Scott Wood
    Cc: Srikar Dronamraju
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/1453962787-15376-1-git-send-email-hemant@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Hemant Kumar
     

03 Apr, 2015

1 commit

  • Enable perf kvm to use perf.data.guest when it is not owned by current
    user or root.

    Example:

    # perf kvm stat record ls
    # chown Yunlong.Song:Yunlong.Song perf.data.guest
    # ls -al perf.data.guest
    -rw------- 1 Yunlong.Song Yunlong.Song 4128937 Apr 2 11:05 perf.data.guest
    # id
    uid=0(root) gid=0(root) groups=0(root),64(pkcs11)

    Before this patch:

    # perf kvm stat report
    File perf.data.guest not owned by current user or root (use -f to override)
    Initializing perf session failed
    # perf kvm stat report -f
    Error: unknown switch `f'

    usage: perf kvm stat report []

    --event
    event for reporting: vmexit, mmio (x86 only),
    ioport (x86 only)
    --vcpu vcpu id to report
    -k, --key key for sorting: sample(sort by samples
    number) time (sort by avg time)
    -p, --pid analyze events only for given process id(s)

    As shown above, the -f option does not work at all.

    After this patch:

    # perf kvm stat report
    File perf.data.guest not owned by current user or root (use -f to override)
    Initializing perf session failed
    # perf kvm stat report -f
    Analyze events for all VMs, all VCPUs:

    VM-EXIT Samples Samples% Time% Min Time Max Time Avg time

    Total Samples:0, Total events handled time:0.00us.

    As shown above, the -f option really works now. Since we have not
    launched any KVM related process, the result shows 0 sample here.

    Signed-off-by: Yunlong Song
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1427982439-27388-5-git-send-email-yunlong.song@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Yunlong Song
     

18 Sep, 2014

1 commit

  • The 'perf kvm stat report' command uses the kvm->pid_str field to keep
    the value of the --pid option. Let's use kvm->opts.target.pid instead.

    Signed-off-by: Alexander Yarygin
    Acked-by: David Ahern
    Cc: Christian Borntraeger
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1409579095-12963-2-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexander Yarygin
     

17 Jul, 2014

3 commits

  • On s390, the vmexit event has a tree-like structure: between
    exit_event_begin and exit_event_end several other events may happen and
    with each of them refining the previous ones.

    This patch adds a decoder for such events to the generic code and also
    the files and kvm-stat.c for s390.

    Commands 'perf kvm stat record', 'report' and 'live' are supported.

    Reviewed-by: David Ahern
    Signed-off-by: Alexander Yarygin
    Acked-by: Christian Borntraeger
    Cc: Christian Borntraeger
    Cc: Cornelia Huck
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1404397747-20939-5-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexander Yarygin
     
  • Current code skips output of the x86 specific HLT event in order to
    avoid flooding the output with enabled --duration option. The events to
    be skipped should be architecture dependent, though.

    Let's add an architecture specific array of events to be skipped and
    introduce a skip_event() function checking against that array.

    Reviewed-by: Christian Borntraeger
    Reviewed-by: Cornelia Huck
    Reviewed-by: David Ahern
    Signed-off-by: Alexander Yarygin
    Cc: Christian Borntraeger
    Cc: Cornelia Huck
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1404397747-20939-4-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexander Yarygin
     
  • Parts of a 'perf kvm stat' code make sense only for x86.

    Let's move this code into the arch/x86/kvm-stat.c file and add
    util/kvm-stat.h for generic structure definitions.

    Add a global array 'kvm_reg_events_ops' for accessing the arch-specific
    'kvm_events_ops' from generic code.

    Since the several global arrays (i.e. 'kvm_events_tp') have been moved
    to arch/*, we can not know their sizes and use them directly in
    builtin-kvm.c. This patch fixes that problem by adding trimming NULL
    element to each array and changing the behavior of their handlers in
    generic code.

    Reviewed-by: David Ahern
    Reviewed-by: Cornelia Huck
    Signed-off-by: Alexander Yarygin
    Acked-by: Christian Borntraeger
    Cc: Christian Borntraeger
    Cc: Cornelia Huck
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1404397747-20939-3-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexander Yarygin