return 0;
 }
 
+static __u32 wellknown_pmu_type(const char *pmu_name)
+{
+       struct {
+               const char *pmu_name;
+               __u32 type;
+       } wellknown_pmus[] = {
+               {
+                       "software",
+                       PERF_TYPE_SOFTWARE
+               },
+               {
+                       "tracepoint",
+                       PERF_TYPE_TRACEPOINT
+               },
+               {
+                       "breakpoint",
+                       PERF_TYPE_BREAKPOINT
+               },
+       };
+       for (size_t i = 0; i < ARRAY_SIZE(wellknown_pmus); i++) {
+               if (!strcmp(wellknown_pmus[i].pmu_name, pmu_name))
+                       return wellknown_pmus[i].type;
+       }
+       return PERF_TYPE_MAX;
+}
+
 struct perf_pmu *perf_pmu__lookup(struct list_head *pmus, int dirfd, const char *name,
                                  bool eager_load)
 {
         * that type value is successfully assigned (return 1).
         */
        if (perf_pmu__scan_file_at(pmu, dirfd, "type", "%u", &pmu->type) != 1) {
-               perf_pmu__delete(pmu);
-               return NULL;
+               /* Double check the PMU's name isn't wellknown. */
+               pmu->type = wellknown_pmu_type(name);
+               if (pmu->type == PERF_TYPE_MAX) {
+                       perf_pmu__delete(pmu);
+                       return NULL;
+               }
        }
 
        /*