mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
Merge 2a987e6502 ("Merge tag 'perf-tools-fixes-for-v5.16-2021-12-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux") into android-mainline
Steps on the way to 5.16-rc4 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Id68e01c73152a0e0b327530ff01e81eca7cdf5e0
This commit is contained in:
@@ -76,7 +76,7 @@
|
||||
#define AMD_CPU_ID_CZN AMD_CPU_ID_RN
|
||||
#define AMD_CPU_ID_YC 0x14B5
|
||||
|
||||
#define PMC_MSG_DELAY_MIN_US 100
|
||||
#define PMC_MSG_DELAY_MIN_US 50
|
||||
#define RESPONSE_REGISTER_LOOP_MAX 20000
|
||||
|
||||
#define SOC_SUBSYSTEM_IP_MAX 12
|
||||
|
||||
@@ -99,6 +99,13 @@ static const struct dmi_system_id button_array_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad X1 Tablet Gen 2"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Microsoft Surface Go 3",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go 3"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
@@ -657,6 +657,18 @@ static int acpi_add(struct acpi_device *device)
|
||||
if (product && strlen(product) > 4)
|
||||
switch (product[4]) {
|
||||
case '5':
|
||||
if (strlen(product) > 5)
|
||||
switch (product[5]) {
|
||||
case 'N':
|
||||
year = 2021;
|
||||
break;
|
||||
case '0':
|
||||
year = 2016;
|
||||
break;
|
||||
default:
|
||||
year = 2022;
|
||||
}
|
||||
break;
|
||||
case '6':
|
||||
year = 2016;
|
||||
break;
|
||||
|
||||
@@ -3015,6 +3015,8 @@ static struct attribute *hotkey_attributes[] = {
|
||||
&dev_attr_hotkey_all_mask.attr,
|
||||
&dev_attr_hotkey_adaptive_all_mask.attr,
|
||||
&dev_attr_hotkey_recommended_mask.attr,
|
||||
&dev_attr_hotkey_tablet_mode.attr,
|
||||
&dev_attr_hotkey_radio_sw.attr,
|
||||
#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
|
||||
&dev_attr_hotkey_source_mask.attr,
|
||||
&dev_attr_hotkey_poll_freq.attr,
|
||||
@@ -5726,11 +5728,11 @@ static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
|
||||
"tpacpi::standby",
|
||||
"tpacpi::dock_status1",
|
||||
"tpacpi::dock_status2",
|
||||
"tpacpi::unknown_led2",
|
||||
"tpacpi::lid_logo_dot",
|
||||
"tpacpi::unknown_led3",
|
||||
"tpacpi::thinkvantage",
|
||||
};
|
||||
#define TPACPI_SAFE_LEDS 0x1081U
|
||||
#define TPACPI_SAFE_LEDS 0x1481U
|
||||
|
||||
static inline bool tpacpi_is_led_restricted(const unsigned int led)
|
||||
{
|
||||
|
||||
@@ -905,6 +905,16 @@ static const struct ts_dmi_data trekstor_primetab_t13b_data = {
|
||||
.properties = trekstor_primetab_t13b_props,
|
||||
};
|
||||
|
||||
static const struct property_entry trekstor_surftab_duo_w1_props[] = {
|
||||
PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct ts_dmi_data trekstor_surftab_duo_w1_data = {
|
||||
.acpi_name = "GDIX1001:00",
|
||||
.properties = trekstor_surftab_duo_w1_props,
|
||||
};
|
||||
|
||||
static const struct property_entry trekstor_surftab_twin_10_1_props[] = {
|
||||
PROPERTY_ENTRY_U32("touchscreen-min-x", 20),
|
||||
PROPERTY_ENTRY_U32("touchscreen-min-y", 0),
|
||||
@@ -1502,6 +1512,14 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Primetab T13B"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* TrekStor SurfTab duo W1 10.1 ST10432-10b */
|
||||
.driver_data = (void *)&trekstor_surftab_duo_w1_data,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "SurfTab duo W1 10.1 (VT4)"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* TrekStor SurfTab twin 10.1 ST10432-8 */
|
||||
.driver_data = (void *)&trekstor_surftab_twin_10_1_data,
|
||||
|
||||
@@ -48,7 +48,6 @@ FEATURE_TESTS_BASIC := \
|
||||
numa_num_possible_cpus \
|
||||
libperl \
|
||||
libpython \
|
||||
libpython-version \
|
||||
libslang \
|
||||
libslang-include-subdir \
|
||||
libtraceevent \
|
||||
|
||||
@@ -32,7 +32,6 @@ FILES= \
|
||||
test-numa_num_possible_cpus.bin \
|
||||
test-libperl.bin \
|
||||
test-libpython.bin \
|
||||
test-libpython-version.bin \
|
||||
test-libslang.bin \
|
||||
test-libslang-include-subdir.bin \
|
||||
test-libtraceevent.bin \
|
||||
@@ -227,9 +226,6 @@ $(OUTPUT)test-libperl.bin:
|
||||
$(OUTPUT)test-libpython.bin:
|
||||
$(BUILD) $(FLAGS_PYTHON_EMBED)
|
||||
|
||||
$(OUTPUT)test-libpython-version.bin:
|
||||
$(BUILD)
|
||||
|
||||
$(OUTPUT)test-libbfd.bin:
|
||||
$(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
|
||||
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
# include "test-libpython.c"
|
||||
#undef main
|
||||
|
||||
#define main main_test_libpython_version
|
||||
# include "test-libpython-version.c"
|
||||
#undef main
|
||||
|
||||
#define main main_test_libperl
|
||||
# include "test-libperl.c"
|
||||
#undef main
|
||||
@@ -177,7 +173,6 @@
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
main_test_libpython();
|
||||
main_test_libpython_version();
|
||||
main_test_libperl();
|
||||
main_test_hello();
|
||||
main_test_libelf();
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <Python.h>
|
||||
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
#error
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -271,8 +271,6 @@ endif
|
||||
|
||||
FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
|
||||
FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
|
||||
FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS)
|
||||
FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS)
|
||||
|
||||
FEATURE_CHECK_LDFLAGS-libaio = -lrt
|
||||
|
||||
|
||||
@@ -528,3 +528,4 @@
|
||||
446 common landlock_restrict_self sys_landlock_restrict_self
|
||||
# 447 reserved for memfd_secret
|
||||
448 common process_mrelease sys_process_mrelease
|
||||
449 common futex_waitv sys_futex_waitv
|
||||
|
||||
@@ -451,3 +451,4 @@
|
||||
446 common landlock_restrict_self sys_landlock_restrict_self sys_landlock_restrict_self
|
||||
# 447 reserved for memfd_secret
|
||||
448 common process_mrelease sys_process_mrelease sys_process_mrelease
|
||||
449 common futex_waitv sys_futex_waitv sys_futex_waitv
|
||||
|
||||
@@ -223,8 +223,6 @@ static unsigned int group(pthread_t *pth,
|
||||
snd_ctx->out_fds[i] = fds[1];
|
||||
if (!thread_mode)
|
||||
close(fds[0]);
|
||||
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
/* Now we have all the fds, fork the senders */
|
||||
@@ -241,8 +239,6 @@ static unsigned int group(pthread_t *pth,
|
||||
for (i = 0; i < num_fds; i++)
|
||||
close(snd_ctx->out_fds[i]);
|
||||
|
||||
free(snd_ctx);
|
||||
|
||||
/* Return number of children to reap */
|
||||
return num_fds * 2;
|
||||
}
|
||||
|
||||
@@ -820,7 +820,7 @@ static int __cmd_inject(struct perf_inject *inject)
|
||||
inject->tool.ordered_events = true;
|
||||
inject->tool.ordering_requires_timestamps = true;
|
||||
/* Allow space in the header for new attributes */
|
||||
output_data_offset = 4096;
|
||||
output_data_offset = roundup(8192 + session->header.data_offset, 4096);
|
||||
if (inject->strip)
|
||||
strip_init(inject);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,9 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u
|
||||
TEST_ASSERT_VAL("#num_dies", expr__parse(&num_dies, ctx, "#num_dies") == 0);
|
||||
TEST_ASSERT_VAL("#num_cores >= #num_dies", num_cores >= num_dies);
|
||||
TEST_ASSERT_VAL("#num_packages", expr__parse(&num_packages, ctx, "#num_packages") == 0);
|
||||
TEST_ASSERT_VAL("#num_dies >= #num_packages", num_dies >= num_packages);
|
||||
|
||||
if (num_dies) // Some platforms do not have CPU die support, for example s390
|
||||
TEST_ASSERT_VAL("#num_dies >= #num_packages", num_dies >= num_packages);
|
||||
|
||||
/*
|
||||
* Source count returns the number of events aggregating in a leader
|
||||
|
||||
@@ -109,6 +109,7 @@ static void load_runtime_stat(struct runtime_stat *st, struct evlist *evlist,
|
||||
struct evsel *evsel;
|
||||
u64 count;
|
||||
|
||||
perf_stat__reset_shadow_stats();
|
||||
evlist__for_each_entry(evlist, evsel) {
|
||||
count = find_value(evsel->name, vals);
|
||||
perf_stat__update_shadow_stats(evsel, count, 0, st);
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
// Copyright (c) 2021 Facebook
|
||||
|
||||
#ifndef __BPERF_STAT_H
|
||||
#define __BPERF_STAT_H
|
||||
|
||||
typedef struct {
|
||||
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
|
||||
__uint(key_size, sizeof(__u32));
|
||||
__uint(value_size, sizeof(struct bpf_perf_event_value));
|
||||
__uint(max_entries, 1);
|
||||
} reading_map;
|
||||
|
||||
#endif /* __BPERF_STAT_H */
|
||||
@@ -1,14 +1,23 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
// Copyright (c) 2021 Facebook
|
||||
#include <linux/bpf.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include "vmlinux.h"
|
||||
#include <bpf/bpf_helpers.h>
|
||||
#include <bpf/bpf_tracing.h>
|
||||
#include "bperf.h"
|
||||
#include "bperf_u.h"
|
||||
|
||||
reading_map diff_readings SEC(".maps");
|
||||
reading_map accum_readings SEC(".maps");
|
||||
struct {
|
||||
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
|
||||
__uint(key_size, sizeof(__u32));
|
||||
__uint(value_size, sizeof(struct bpf_perf_event_value));
|
||||
__uint(max_entries, 1);
|
||||
} diff_readings SEC(".maps");
|
||||
|
||||
struct {
|
||||
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
|
||||
__uint(key_size, sizeof(__u32));
|
||||
__uint(value_size, sizeof(struct bpf_perf_event_value));
|
||||
__uint(max_entries, 1);
|
||||
} accum_readings SEC(".maps");
|
||||
|
||||
struct {
|
||||
__uint(type, BPF_MAP_TYPE_HASH);
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
// Copyright (c) 2021 Facebook
|
||||
#include <linux/bpf.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include "vmlinux.h"
|
||||
#include <bpf/bpf_helpers.h>
|
||||
#include <bpf/bpf_tracing.h>
|
||||
#include "bperf.h"
|
||||
|
||||
struct {
|
||||
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
|
||||
@@ -13,8 +11,19 @@ struct {
|
||||
__uint(map_flags, BPF_F_PRESERVE_ELEMS);
|
||||
} events SEC(".maps");
|
||||
|
||||
reading_map prev_readings SEC(".maps");
|
||||
reading_map diff_readings SEC(".maps");
|
||||
struct {
|
||||
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
|
||||
__uint(key_size, sizeof(__u32));
|
||||
__uint(value_size, sizeof(struct bpf_perf_event_value));
|
||||
__uint(max_entries, 1);
|
||||
} prev_readings SEC(".maps");
|
||||
|
||||
struct {
|
||||
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
|
||||
__uint(key_size, sizeof(__u32));
|
||||
__uint(value_size, sizeof(struct bpf_perf_event_value));
|
||||
__uint(max_entries, 1);
|
||||
} diff_readings SEC(".maps");
|
||||
|
||||
SEC("raw_tp/sched_switch")
|
||||
int BPF_PROG(on_switch)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
// Copyright (c) 2020 Facebook
|
||||
#include <linux/bpf.h>
|
||||
#include "vmlinux.h"
|
||||
#include <bpf/bpf_helpers.h>
|
||||
#include <bpf/bpf_tracing.h>
|
||||
|
||||
|
||||
@@ -2321,6 +2321,7 @@ out:
|
||||
#define FEAT_PROCESS_STR_FUN(__feat, __feat_env) \
|
||||
static int process_##__feat(struct feat_fd *ff, void *data __maybe_unused) \
|
||||
{\
|
||||
free(ff->ph->env.__feat_env); \
|
||||
ff->ph->env.__feat_env = do_read_string(ff); \
|
||||
return ff->ph->env.__feat_env ? 0 : -ENOMEM; \
|
||||
}
|
||||
@@ -4124,6 +4125,7 @@ int perf_event__process_feature(struct perf_session *session,
|
||||
struct perf_record_header_feature *fe = (struct perf_record_header_feature *)event;
|
||||
int type = fe->header.type;
|
||||
u64 feat = fe->feat_id;
|
||||
int ret = 0;
|
||||
|
||||
if (type < 0 || type >= PERF_RECORD_HEADER_MAX) {
|
||||
pr_warning("invalid record type %d in pipe-mode\n", type);
|
||||
@@ -4141,11 +4143,13 @@ int perf_event__process_feature(struct perf_session *session,
|
||||
ff.size = event->header.size - sizeof(*fe);
|
||||
ff.ph = &session->header;
|
||||
|
||||
if (feat_ops[feat].process(&ff, NULL))
|
||||
return -1;
|
||||
if (feat_ops[feat].process(&ff, NULL)) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!feat_ops[feat].print || !tool->show_feat_hdr)
|
||||
return 0;
|
||||
goto out;
|
||||
|
||||
if (!feat_ops[feat].full_only ||
|
||||
tool->show_feat_hdr >= SHOW_FEAT_HEADER_FULL_INFO) {
|
||||
@@ -4154,8 +4158,9 @@ int perf_event__process_feature(struct perf_session *session,
|
||||
fprintf(stdout, "# %s info available, use -I to display\n",
|
||||
feat_ops[feat].name);
|
||||
}
|
||||
|
||||
return 0;
|
||||
out:
|
||||
free_event_desc(ff.events);
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp)
|
||||
|
||||
@@ -15,7 +15,7 @@ int smt_on(void)
|
||||
if (cached)
|
||||
return cached_result;
|
||||
|
||||
if (sysfs__read_int("devices/system/cpu/smt/active", &cached_result) > 0)
|
||||
if (sysfs__read_int("devices/system/cpu/smt/active", &cached_result) >= 0)
|
||||
goto done;
|
||||
|
||||
ncpu = sysconf(_SC_NPROCESSORS_CONF);
|
||||
|
||||
Reference in New Issue
Block a user