<commit_before>#include "papi.h"

int get_memory_info( PAPI_mem_info_t * mem_info ){
   int retval = 0;
   return PAPI_OK;
}

long _papi_hwd_get_dmem_info(int option){
}<commit_msg>Support for dynamic memory information added for Alpha<commit_after>#include "papi.h"
#include <sys/procfs.h>
#include <stdio.h>
#include <fcntl.h>

int get_memory_info( PAPI_mem_info_t * mem_info ){
   int retval = 0;
   return PAPI_OK;
}

long _papi_hwd_get_dmem_info(int option){
   pid_t pid = getpid();
   prpsinfo_t info;
   char pfile[256];
   int fd;

   sprintf(pfile, "/proc/%05d", pid);
   if((fd=open(pfile,O_RDONLY)) <0 ) {
        DBG((stderr,"PAPI_get_dmem_info can't open /proc/%d\n",pid));
        return(PAPI_ESYS);
   }
   if(ioctl(fd, PIOCPSINFO,  &info)<0){
        return(PAPI_ESYS);
   }
   close(fd);
 switch(option){
   case PAPI_GET_RESSIZE:
        return(info.pr_rssize);
   case PAPI_GET_SIZE:
        return(info.pr_size);
   default:
        return(PAPI_EINVAL);
  }
}
{'fraction_non_alphanumeric': 0.1346938775510204, 'fraction_numerical': 0.009183673469387756, 'mean_word_length': 3.6714285714285713, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6094263', 'n_tokens_mistral': 413, 'n_tokens_neox': 402, 'n_words': 74}