1 /*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * SPDX-License-Identifier: GPL-2.0
4 *
5 * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT.
6 * Do not use in new code.
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14
15 #include <trace/hooks/mm.h>
16 #include <linux/module.h>
17 #include <linux/init.h>
18 #include <linux/kernel.h>
19
vendor_do_mmap(void * data,vm_flags_t * vm_flags,int * err)20 static void vendor_do_mmap(void *data, vm_flags_t *vm_flags, int *err)
21 {
22 pr_info("%s\n", __func__);
23 }
24
mmap_test_init_module(void)25 static int mmap_test_init_module(void)
26 {
27 return register_trace_vendor_do_mmap(&vendor_do_mmap, NULL);
28 }
29
mmap_test_exit_module(void)30 static void mmap_test_exit_module(void)
31 {
32 unregister_trace_vendor_do_mmap(&vendor_do_mmap, NULL);
33 }
34
35 /* module entry points */
36 module_init(mmap_test_init_module);
37 module_exit(mmap_test_exit_module);
38 MODULE_LICENSE ("GPL v2");
39