You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: kconfig.go
    path of file: ./repos/parca-agent/pkg/kernel
    
    the code of the file until where you have to start completion: // Copyright 2022-2024 The Parca Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ap
    
func CheckBPFEnabled() error {
	for _, dir := range []string{"/proc", "/boot"} {
		if _, err := os.Stat(dir); err != nil {
			if os.IsNotExist(err) || errors.Is(err, fs.ErrNotExist) {
				return fmt.Errorf("failed to read directory %q, it does not exist", dir)
			}
			if os.IsPermission(err) {
				return fmt.Errorf("failed to read directory %q, agent does not have access", dir)
			}
			return err
		}
	}

	uname, err := unameRelease()
	if err != nil {
		return err
	}
	configPaths := []string{
		"/proc/config.gz",
		"/boot/config",
		"/boot/config-" + uname,
	}

	var result error
	for _, configPath := range configPaths {
		if _, err := os.Stat(configPath); err != nil {
			if os.IsNotExist(err) || errors.Is(err, fs.ErrNotExist) {
				continue
			}
			result = errors.Join(result, err)
			continue
		}
		isBPFEnabled, err := checkBPFOptions(configPath)
		if err != nil {
			return err
		}
		// The only success case.
		if isBPFEnabled {
			return nil
		}
	}

	if result != nil {
		return result
	}

	// If we reach this point, either we have not found a config file or required options are not enabled.
	return fmt.Errorf("kernel config not found, tried paths: %s", strings.Join(configPaths, ", "))
}