~ubuntu-branches/ubuntu/trusty/linux-linaro-omap/trusty

« back to all changes in this revision

Viewing changes to tools/perf/util/header.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-57i0gl3v99b3lkfg
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
             *linkname = malloc(size), *targetname;
194
194
        int len, err = -1;
195
195
 
196
 
        if (is_kallsyms)
 
196
        if (is_kallsyms) {
 
197
                if (symbol_conf.kptr_restrict) {
 
198
                        pr_debug("Not caching a kptr_restrict'ed /proc/kallsyms\n");
 
199
                        return 0;
 
200
                }
197
201
                realname = (char *)name;
198
 
        else
 
202
        } else
199
203
                realname = realpath(name, NULL);
200
204
 
201
205
        if (realname == NULL || filename == NULL || linkname == NULL)
873
877
                struct perf_evsel *evsel;
874
878
                off_t tmp;
875
879
 
876
 
                if (perf_header__getbuffer64(header, fd, &f_attr, sizeof(f_attr)))
 
880
                if (readn(fd, &f_attr, sizeof(f_attr)) <= 0)
877
881
                        goto out_errno;
878
882
 
 
883
                if (header->needs_swap)
 
884
                        perf_event__attr_swap(&f_attr.attr);
 
885
 
879
886
                tmp = lseek(fd, 0, SEEK_CUR);
880
887
                evsel = perf_evsel__new(&f_attr.attr, i);
881
888
 
934
941
        return -ENOMEM;
935
942
}
936
943
 
937
 
u64 perf_evlist__sample_type(struct perf_evlist *evlist)
938
 
{
939
 
        struct perf_evsel *pos;
940
 
        u64 type = 0;
941
 
 
942
 
        list_for_each_entry(pos, &evlist->entries, node) {
943
 
                if (!type)
944
 
                        type = pos->attr.sample_type;
945
 
                else if (type != pos->attr.sample_type)
946
 
                        die("non matching sample_type");
947
 
        }
948
 
 
949
 
        return type;
950
 
}
951
 
 
952
 
bool perf_evlist__sample_id_all(const struct perf_evlist *evlist)
953
 
{
954
 
        bool value = false, first = true;
955
 
        struct perf_evsel *pos;
956
 
 
957
 
        list_for_each_entry(pos, &evlist->entries, node) {
958
 
                if (first) {
959
 
                        value = pos->attr.sample_id_all;
960
 
                        first = false;
961
 
                } else if (value != pos->attr.sample_id_all)
962
 
                        die("non matching sample_id_all");
963
 
        }
964
 
 
965
 
        return value;
966
 
}
967
 
 
968
944
int perf_event__synthesize_attr(struct perf_event_attr *attr, u16 ids, u64 *id,
969
945
                                perf_event__handler_t process,
970
946
                                struct perf_session *session)